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!

Why don't this work..

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
This is taken form the Help file in Flash MX, I made a 20frame movie and used this on a push button but I wont work and the program. And it did not come up whit any errors !!

----------------------------------
on(release) {
gotoAndPlay(16);
}
----------------------------------
 
can you give us a little more to work with?
do u have a stop action on the frame that the push button is on? __________________________________
Keep On Coding!!

Lumstar
 
Maybe...

on(release) {
_root.gotoAndPlay(16);
}
Regards,

new.gif
 
Hmm thats works, why the _root. thing, what dos it do ?

But thx anyway :)
 
Oh yeah onemore thing, why won't it jump to another scene, do I have to replace the _root. whit something els ?

-------------------------------------
on(release) {
_root.gotoAndPlay("link",16);
}
------------------------------------
 
Because you can't target the main movie's timeline from within a movie clip (your push button) or from another external movie loaded on another level, without specifying the targeted level. In fact, you're lucky that the above would even work for you. The better method to target a particular frame in this situation is to label that frame, and then target that unique label as:

on (press){
_root.gotoAndPlay("label");
}

Or...

on (press){
_level0.gotoAndPlay("label");
}

Using a frame number (especially if you have several scenes) could get you in a lot of trouble. Since scene names are meaningless from movie clips or external movies, the targeted frame number is in fact a cumulative number of all the frames in the scenes previous to the targeted one.
In other words, if your were targeting frame 1 of scene 3, and you had a preloader of 4 frames, a scene 1 of 100 frames, and a scene 2 of 50 frames, you would have to target 4+100+50+1= 155. Easy enough when you understand the concept. The problem arises when you edit one scene (shorten scene 1 for example), you'll then have to re-calculate that cumulative number and correct all of your goto's accordingly! That doesn't occur with the label method, the label beeing attached to that particular frame until you delete it, and doesn't change when editing scenes.
Regards,

new.gif
 
Well I think I have trayed something like that, but maby I did something wrong.
I can't beleve how hard it is to get this to work, I like the Director way better, mush more simpel :)

well Thx again !!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top