dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Preloading Sequence for loadMovie function.

  1. #1
    Cichlisuite noiselab's Avatar
    Join Date
    Nov 2005
    Location
    Seattle
    Posts
    189

    Preloading Sequence for loadMovie function.

    Ok so I haven't done much scripting in my flash life yet, but i'm starting to get more into it. I'm thinking about making a website ( well it's actually already made but its half flash half HTMl and I'm wanting to transfer it completely into flash in a few months. Now the site has 6 sections and I want those to load into the main movie as external files. The loading code is pretty clear to me as is the code for positioning the loaded movie in the right place. I've looked on the internet for more information on PRELOADING external files, but didn't quite find what I was looking for.

    What I'm trying to do is when the button is pressed, i want there to be a sequence "wiping" the current content off the page ( which is easy ) and then display some kind of aloading animation while the external movie is preloading.

    Now, how do I get that preloader to work ? Do I make one in the external file or is there a code accompanied by the animation that I can put in the main movie ?

    Thanks for your help guys !

  2. #2
    ze fivefoil
    Join Date
    Apr 2005
    Location
    Human
    Posts
    2
    I think I understand what you are going for...

    The 'wipe animation' should occur as a loaded movieclip within an empty movieclip from your main movie. One way to do it would be to make sure the last frame of the 'wipe' was off-screen and won't display over the loading animation that comes afterwards. Or use the unloadmovie option.

    As for the preloader -(loading anim) I would create that in the first 2 frames of the movieclip and then straight in - I used the same thing on my site: www.gd30.com for the banner area to change over to new content. It is kind of a 'wipe' effect in itself, but with twinkly bits

    Might help...
    More human than human.

    http://www.gd30.com

    And this is pretty cool: proper encrypted email at last: privatepost.com

  3. #3
    Cichlisuite noiselab's Avatar
    Join Date
    Nov 2005
    Location
    Seattle
    Posts
    189
    So what you mean is that the external files that are loaded for each section on your website are actually INSIDE the external file ? They arent preloaded by a sequence inside the main movie ?

  4. #4
    Junior Member
    Join Date
    Dec 2005
    Posts
    12
    Here's a great resource for preloaders. The one described in this tutorial explains how to use the movieClipLoader class to preload external movieClips. You might also want to check out event listeners to get your preloader to run during specific points in your movie. Good luck

    http://www.actionscript.org/tutorial...04/index.shtml

  5. #5
    ze fivefoil
    Join Date
    Apr 2005
    Location
    Human
    Posts
    2
    Quote Originally Posted by noiselab
    So what you mean is that the external files that are loaded for each section on your website are actually INSIDE the external file ? They arent preloaded by a sequence inside the main movie ?

    Yep. Thats it. I have one main frame 'mainmovie' with three empty movieclips to-banner, left and right - the bottom doesnt change.

    Each of these emty movieclips load extenal .swf files with a preloader in the first 2 frames of each - so when you click the 'services' button for example:


    on (release) {

    //load Movie Behavior
    if(this._parent._parent.gd30.externals.win2loader == Number(this._parent._parent.gd30.externals.win2loa der)){
    loadMovieNum("servblack.swf",this._parent._parent. gd30.externals.win2loader);
    } else {
    this._parent._parent.gd30.externals.win2loader.loa dMovie("servblack.swf");
    }
    //End Behavior


    //load Movie Behavior
    if(this._parent._parent.gd30.externals.win1loader == Number(this._parent._parent.gd30.externals.win1loa der)){
    loadMovieNum("servicetxt.swf",this._parent._parent .gd30.externals.win1loader);
    } else {
    this._parent._parent.gd30.externals.win1loader.loa dMovie("servicetxt.swf");
    }
    //End Behavior

    //load Movie Behavior
    if(this._parent._parent.gd30.externals.leftload == Number(this._parent._parent.gd30.externals.leftloa d)){
    loadMovieNum("void.swf",this._parent._parent.gd30. externals.leftload);
    } else {
    this._parent._parent.gd30.externals.leftload.loadM ovie("void.swf");
    }
    //End Behavior

    //load Movie Behavior
    if(this._parent._parent.gd30.externals.win3loader == Number(this._parent._parent.gd30.externals.win3loa der)){
    loadMovieNum("headerserv.swf",this._parent._parent .gd30.externals.win3loader);
    } else {
    this._parent._parent.gd30.externals.win3loader.loa dMovie("headerserv.swf");
    }
    //End Behavior
    }

    Note: I also have an empty external clip which I named 'void.swf' in case I dont want to load any new information.

    Hope that makes some sense.
    More human than human.

    http://www.gd30.com

    And this is pretty cool: proper encrypted email at last: privatepost.com

  6. #6
    Cichlisuite noiselab's Avatar
    Join Date
    Nov 2005
    Location
    Seattle
    Posts
    189
    See what it does for me is, I push the load button that loads the movie into the movieclip, and nothing happens for a few seconds, after that the MC start displaying the external file.

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