-
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.
-
Senior Member
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.
-
Thanks, will give that a go now
-
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');
}
-
Senior Member
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.
-
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
-
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
-
Excellent
Many thanks for your help man!
-
Senior Member
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.
-
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?
-
Senior Member
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.
-
Ohhhh, now I get you.
Thanks again, much appreciated!!
-
Senior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|