PDA

View Full Version : stopping a swf from playing in main scene


pilly
02-12-2004, 10:39 PM
I'd just like to mention - I'm very new to AS...and I apologize for such a weak post. I've searched and even tried coding for hours with no luck:(

I've followed the tut below - basically what happens...the "content1.swf" plays in the first scence. I'm trying to figure out how to stop "content1" from playing before the user/viewer hits button1.

Here's what the code looks like (minus the preloader from the tut).

nextMovie="content1.swf";
//load the starting movie into level 1
loadMovieNum(nextMovie,1);
//button1 actions
button1.onRelease=function(){
//this makes sure that content 1 isn't already loaded
if(nextMovie!="content1.swf"){
//set the variable that holds the name of the movie to be loaded
nextMovie="content1.swf";
//tell the currently loaded content movie to play it's outro animation
_level1.gotoAndPlay("outro");
}
}
//button2 actions
button2.onRelease=function(){
//this makes sure that content 1 isn't already loaded
if(nextMovie!="content2.swf"){
//set the variable that holds the name of the movie to be loaded
nextMovie="content2.swf";
//tell the currently loaded content movie to play it's outro animation
_level1.gotoAndPlay("outro");
}
}

Any help would be great. Thanks for reading - and again, I apologize in advance for a boring post.

http://www.tableau.com.au/tutorials/smooth_transitions/

oldnewbie
02-13-2004, 01:15 AM
You should have a stop(); action on the first frame of the content1.swf, and only start it up with the button press.

pilly
02-13-2004, 07:54 AM
Mmm...once again, thank you very much for your response. I'll have to test it out once I get home! Sorry for the stupid questions...I appreciate your help greatly!

pilly
02-13-2004, 05:52 PM
A stop action in the first frame of content1 didnt work. It doesnt load - but when I click content2...the outro of content1 plays (the intro of content2 should play). If I can't figure it out - I'll prolly just add a precontent1 swf (something like a home link). Again, thanks for your time!