dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Slideshow

  1. #1
    Junior Member
    Join Date
    May 2004
    Posts
    10

    Slideshow

    Here is my slideshow located on the portfolio of site I am designing (p.s click on go):

    http://www.plugindesign.co.uk/new/portfolio.html

    It works fine until I call the portfolio movie from the main movie (p.s click on portfolio):

    http://www.plugindesign.co.uk/new/index.html

    I think it might have something to do with the module preloader set up on the main timeline, this basically creates empty movieclips to load the external movies into.

    Any help would be appreciated, I can supply the actionscript or even the .fla files if required.

    Thanks

  2. #2
    Junior Member
    Join Date
    May 2004
    Posts
    10
    Here is the main code attached to the main timeline that calls all the movies:

    function init() {
    //Load the preloader
    var obj = new Object();
    obj._x = 310;
    obj._y = 230;
    obj._visible = 0;
    this.attachMovie("preloader", "preloader", 9, obj);
    //Create holder movieclips for the different sections
    this.createEmptyMovieClip("navigation", 8);
    this.createEmptyMovieClip("home", 2);
    this.createEmptyMovieClip("portfolio", 3);
    this.createEmptyMovieClip("services", 4);
    this.createEmptyMovieClip("jobs", 5);
    this.createEmptyMovieClip("login", 6);
    this.createEmptyMovieClip("contact", 7);
    //Load the movies we need to start
    navigation.loadMovie("navigation.swf");
    home.loadMovie("home.swf");
    //Make an array containing the paths to the objects we want to preload
    var preloadContent = new Array(this, navigation, home);
    //Call the preload function
    preload(preloadContent);
    //Store the first section used in a variable
    lastSection = home;
    }

    function switchSection(section) {
    //Unload the last section used
    lastSection.unloadMovie();
    //Load the new section into the appropriate target
    this[section].loadMovie(section + ".swf");
    //Update the lastSection variable with the new section
    lastSection = this[section];
    //Preload the new section
    var preloadContent = new Array(this[section]);
    preload(preloadContent);
    }

    function preload(preloadContent) {
    //Turn on and initialize the preloader
    preloader._visible = 1;
    preloader.bar._xscale = 0;
    preloader.display.text = "0% Loaded";
    //Set an interval to update the loading progress
    intervalId = setInterval(preloadCallback, 10, preloadContent);
    }

    function preloadCallback(preloadContent) {
    //Initialize variables to track the loading progress
    var download = 0;
    var downloaded = 0;
    var percentLoaded = 0;
    //Loop through each object passed to the function
    for (var i in preloadContent) {
    //Make sure the object exists, if not, exit the function
    if (preloadContent[i].getBytesTotal() > 0) {
    //Grab the total and loaded bytes
    download += preloadContent[i].getBytesTotal();
    downloaded += preloadContent[i].getBytesLoaded();
    } else {
    return;
    }
    //Update the preloader display
    percentLoaded = Math.ceil(downloaded / download * 100);
    preloader.display.text = percentLoaded + "% Loaded";
    preloader.bar._xscale = percentLoaded;
    updateAfterEvent();
    }
    //See if we're finished
    if (downloaded == download && download > 0) {
    //Initialize the preloaded movies
    for (var i in preloadContent) {
    preloadContent[i].gotoAndStop("run");
    }
    //Delete the interval and turn off the preloader
    clearInterval(intervalId);
    preloader._visible = 0;

    }

    }




    Really hope someone can help me on this, been struggling to get this working for the past week... ARRRRGGGGHHHHH

  3. #3
    Junior Member
    Join Date
    May 2004
    Posts
    10
    Anyone

  4. #4
    Senior Member
    Join Date
    Jun 2004
    Posts
    193
    the same kind of thing happens when i play my portfolio from within another flash file, none of the buttonMCs work anymore,

    beedle

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center