A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: Preloading individual scenes

  1. #1
    Junior Member
    Join Date
    Mar 2006
    Posts
    13

    Preloading individual scenes

    Hey,

    Could anyone help me out with my preloading issue.

    Basically, Ive created a site that is pretty small in file size but when I add my animation scene, the sites loading slows right down.

    I currently have a preloader to load the whole site in one go but would prefer to just preload the animation page.

    www.alexdunford.com

    Any help would be great.

  2. #2
    Senior Member Bernz's Avatar
    Join Date
    Jun 2005
    Location
    Mid-Eastern U.S.
    Posts
    161
    You can use the loadMovie() function to replace an existing movieClip with an external swf file.
    Try looking it up at http://livedocs.macromedia.com.

    Hope that helps! If this doesn't help you enough, just say so.

  3. #3
    Junior Member
    Join Date
    Mar 2006
    Posts
    13
    Thanks, will give that a go now

  4. #4
    Junior Member
    Join Date
    Mar 2006
    Posts
    13
    I just can't seem to get it to open that 2nd swf file...

    If I need a button to open the second swf file named alexdunford.com_02
    Would the code be close to ...

    on (release) {
    loadMovie('alexdunford.com_2.swf',1,'GET');
    }

  5. #5
    Senior Member onine's Avatar
    Join Date
    Mar 2005
    Posts
    627
    Hi

    Create an empty movie clip and put it on the stage. Call the clip "emptyClip" and give it an instance name of "emptyClip". As you put it on the stage, bear in mind that its position will be the top-left hand extreme of the .swf you are going to load. Change your script to this:
    Code:
    on (release) {
    emptyClip.loadMovie("alexdunford.com_2.swf");
    }
    Hope that helps

    edit
    nice folio by the way cool reel
    Last edited by onine; 03-19-2006 at 06:32 PM.

  6. #6
    Junior Member
    Join Date
    Mar 2006
    Posts
    13
    Im really sorry but I just dont understand that lol (but I am a newbie)...

    Do I create an empty clip in flash and export it as htm?

    Is the instance the name of the page? eg, emptyClip.htm

    Thanks

  7. #7
    Knows where you live
    Join Date
    Oct 2004
    Posts
    944
    loadMovie loads a .swf into a movieclip on the stage.
    emptyClip.loadMovie("alexdunford.com_2.swf");
    will load the movie "alexdunford.com_2.swf" into the movieClip with the instance name emptyClip.
    The greatest pleasure in life is doing what people say you cannot do.
    - Walter Bagehot
    The height of cleverness is to be able to conceal it.
    - Francois de La Rochefoucauld

  8. #8
    Junior Member
    Join Date
    Mar 2006
    Posts
    13
    Excellent

    Many thanks for your help man!

  9. #9
    Senior Member onine's Avatar
    Join Date
    Mar 2005
    Posts
    627
    Quote Originally Posted by strikefive01
    Do I create an empty clip in flash and export it as htm?
    Is the instance the name of the page? eg, emptyClip.htm
    Hey, no worries.

    Go into the file where you have created your site - the flash project where you have the menu on the left and the big box on the right.

    Go to insert > new symbol or press ctrl+f8. This brings up the new symbol dialogue box. Name the new symbol "emptyClip", make sure the behaviour is set to movie and press ok.

    When you press ok you are taken to symbol editing mode, but you dont want to edit it because you want it to stay empty for now. Come out of editing mode by pressing "scene1" at the top left of screen.

    Ok. Now you are back to looking at your project. Open the library (window > library or ctrl+l) and find emptyClip in there. Create a new layer in the timeline and call it "empty clip" or "animation section" or something else descriptive. With that layer selected, drag emptyClip from the library to the stage and position it in the top left of the stage.

    Then follow the rest of the instruction given before - put
    Code:
    on (release) {
    emptyClip.loadMovie("alexdunford.com_2.swf");
    }
    onto the button you wish to use to load the .swf. Good luck

    edit - whoops - I forgot to say, when you drag the clip to the stage, you have to select it and give it an instance name - this is very important as the script wont work without it.

    Select emptyClip and find the properties panel, there will be a text field which says <Instance Name>, make sure to type "emptyClip" in here.
    Last edited by onine; 03-19-2006 at 06:54 PM.

  10. #10
    Junior Member
    Join Date
    Mar 2006
    Posts
    13
    Really sorry, just one more question.

    Once I have done the above, making the emptyClip, do I export that as a swf or htm?

    Will my alexdunford.com_2.swf file load on top of this?

  11. #11
    Senior Member onine's Avatar
    Join Date
    Mar 2005
    Posts
    627
    Forget htm and exporting stuff it has nothing to do with this.

    You should have one .swf with your animation section in it and one .swf with all your other, main, content in it. This code (and empty clip) goes in the main section - the main .swf - to load the other .swf into it.

  12. #12
    Junior Member
    Join Date
    Mar 2006
    Posts
    13
    Ohhhh, now I get you.

    Thanks again, much appreciated!!

  13. #13
    Senior Member onine's Avatar
    Join Date
    Mar 2005
    Posts
    627
    no worries

    check this if your still confused

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