A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Preloader issues for movies loaded into targets

  1. #1
    Junior Member
    Join Date
    Jun 2004
    Location
    Salem, Oregon
    Posts
    5

    Preloader issues for movies loaded into targets

    Hello all,

    I am having issues with getting preloaders to work on movies that are loaded into another movies blank placeholder. If anyone can help me with this I would be very grateful. Thanks

    Duncan

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Any code in the external swf that refers to the _root will point at the wrong timeline, as the external swf is regarded as the movieclip its loaded into ( and movieclips dont have a _root ).

    So you have to adjust your paths accordingly, or use a general preloader in the main swf for the external files...like... ON the place holder...

    onClipEvent (enterFrame) {
    tb = math.round(this.getBytesTotal()/1024);
    lb = math.round(this.getBytesLoaded()/1024);
    perc = math.round((lb/tb)*100);
    if (lb>=tb) {
    _parent.loadBar._visible = 0;
    } else {
    _parent.perc = perc;
    _parent.loadBar._width = perc;
    _parent.loadBar._visible = 1;
    }
    }


    loadBar being a small movieclip on the main timeline.( or the same timeline the container clip is at ).

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #3
    Junior Member
    Join Date
    Jun 2004
    Location
    Salem, Oregon
    Posts
    5

    Help with the path

    Thank you for the ultra fast response!! When I test the movie that is to be loaded into a placeholder, run the bandwidth profiler, debug at 56k and then stream the movie it works fine... But once up on the webpage the preloader fly’s and loads even though the photo album is not fully loaded. It is like you said pointing at the wrong timeline. When I try to adjust my path I have no choice it seems but to use _root. Are the actions you posted referring to using a general preloader or for adjusting the path? Sorry I am a newb who at times requires a bit of spoon feeding. Thanks,

    Duncan

    you can see the problem in action at http://www.thesouzas.net

    photos>January 2004

  4. #4
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    My code is a general preloader in the main swf.

    The optÃ*ons to _root are _parent ( one timeline up ) and this. ( current timeline )

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  5. #5
    Junior Member
    Join Date
    Jun 2004
    Location
    Salem, Oregon
    Posts
    5

    Works like a champ!!!

    Thanks, between your post and stumbling upon this other dudes post:
    Originally posted by modulater
    Hi again,

    woops

    External swf's you always give the preloader to the external file.

    Like this.
    onClipEvent (enterFrame) {
    _xscale = (this.getBytesLoaded()/this.getBytesTotal())*100;
    if(this.getBytesLoaded()>=this.getBytesTotal()){
    this.gotoAndPlay(2);
    }
    }
    This is the code appliade to the preloaderbar.You just make a mc like 100pixels on 5 pixels.Place it on the scene frame1.Give the code to the object.scale the preloader at 1% with

    You use 'this' instead of _root when you load in external._root in the main.fla(swf) and_parent inside an mc.

    In the main file you refer your button to the external file usig target or loading into level.

    Btw in frame2 you put in your graphic or mc on the scene of the external file.

    Hope that helps.
    it finally sunk in; it takes us newbs a while sometimes Thanks again, I don't know what I would do without these forums.

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