Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AS question with loading a movie and going to a specific frame in it

Status
Not open for further replies.

jmp2006

Technical User
Dec 17, 2006
3
US
thank you so much for your help.
I'm a beginner in AS and would like some help in what I'd need to add to the below so that when the "content2.swf" loads, i want it to go to frame 10.


button2.onRelease=function(){
loadMovie ("content2.swf", "_root.content");

thank you so much.
jp
 
You need to set a variable (_level0.frameToGo = 10, as an example...) on your loadMovie call...
You also need to make sure (with some preloading code...) that the movie is fully loaded and add a checking script on the loaded .swf's first frame, along with a stop() action, that will re-direct the playhead to the appropriate frame, based on the value of the variable that was set on the button press.

Better to target a labeled frame than a frame number.

Regards. Web Hosting - Web Design
03/13/05 -> OLDNEWBIE VS FLASHKIT
 
Thanks oldnewbie

wow, that seems like a lot of code for what i thought was going to be some simple navigation.
So the variable would be , ie, using a frame label love (frame 10) as you suggested,
var = love
love = goto.love (which would be frame lable at frame 10)

but i'm lost on how to add that into the AS using as you suggested "_level0.frameToGo = 10" as an example..
and where that sits in the string.
I understand i need to create the variable first, before i can use it. I'm just lost as to where it sits in the string. also, as you suggested, it would seem i'd have to put in an onEnterFrame event that would apparently operate from an if/else condition so should the variable be present on the load, it would goto the frame "label."


button2.onRelease=function(){
loadMovie ("content2.swf", "_root.content");
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top