PDA

View Full Version : problem with loading swf's


tails
09-29-2006, 09:38 AM
Hi guys,

i have a problem with switching between swf files in my project.

I have one main swf file where i load another swf into a movieclip, this swf contains a imported movie on the timeline and before the movie a simple preloader(same for swf2). This movie has an stop action at the last frame and then a menu appears where you can choose to go to other parts of the project.

the last frame of the loaded swf is exactly the same as the first frame of the second swf. My problem is that when you click on the button to go to the next floor of the building ( see the project file) you see nothing for a fraction of a second.

i really dont know how to solve this problem :(

here are my project files

Download (http://www.megaupload.com/?d=YPDU2ZY6)

tails
09-29-2006, 09:42 AM
sorry posted this thread double because i got a error the first time, one can be closed now.


sorry!!!:o

Iodine
09-29-2006, 12:59 PM
Tails,

I downloaded your source and got an answer for you. (i just have to note here, that that intro animation takes absolute AGES)

First a little reference...When you use the

loadmovie ();

and point it at a movie clip that has a movie loaded into already (in your case "begin.swf" is loaded in placeholder_1 originally) it replaces what is already in there, not a clean swap however, unload then load.

That split second blink you saw was the natural delay during the swapping. begin.swf is unloaded *white flash* then verdieping1.swf is loaded in its place. Thats why the result was not seamless.

The solution (at least one of them) would be as follows.


Create a new MC_holder on the intro work area called "placeholder_2" and place it directly ontop of "placeholder_1"
go to the button instance on the begin.swf timeline and replace your button code with the following.

on (release) {

loadMovie("verdieping1.swf", _root.placeholder_2);
unloadMovie("placeholder_1")
}



*Explaination*

This workaround works essintially because you are not replacing the original "begin.swf" you are loading the new movie on top of it. You then unload the begin.swf movie, always good to keep the place tidy of what your not using. This way begin.swf is not unloaded until your specific floor animation is loaded in, thus preventing unwated stage exposure.

Hope thats clear for you Tails,

Cheers
][

tails
09-29-2006, 02:16 PM
THANKS for your reply and explanation Iodine!:)

Im gonna try to make it work.

and yeah you're right about the intro animation it takes way too long, im also gonna change this.

I will let you know here if it worked :)

Iodine
09-29-2006, 04:59 PM
Cheers Tails, let me know.

][

tails
10-03-2006, 09:31 AM
i made a second version with your help, it works ok :).
Im going to get a lot of load_mc's with this method :O

http://rapidshare.de/files/35314322/versie2.rar.html

here is my second version with a short intro movie ;)