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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Go to and play" problems 2

Status
Not open for further replies.

nighttrain20

Technical User
Jan 1, 2002
27
US
In Scene1 I have text in layer 1, and my button in layer 2.
In Scene2 I have my audio and pics I want to play when the button is released. in the last frame of the button layer my action is:

on (release) {
gotoAndPlay ("scene 2", 1);
}
My text and button come up and then it goes right to scene 2 without stopping. Any help? Thanks
 
Code:
on (release) {
    gotoAndStop ("scene 2", 1);
}
Ya' Gotta Love It!
sleepyangelsBW.jpg
 
There should also be a stop in the first scene, otherwise it will just go on playing scene 2.
If it's a 1 frame scene, then put a stop action on it. If it's longer, put a stop on the last frame.
Same applies to scene 2. If it's a one frame deal again, Tulsa's suggestion will work, because it'll stop on the first frame. But if it's gota play, you should put a stop on it somewhere, or else it'll loop back to scene 1 when it reaches it's end.

Regards,
new.gif
 
Where would I put my Stop action? I put a stop action in the last frame of the text and it just stops the there and the button does nothing, I also put stop before the "Goto and Play action and that did not work. There are 2 layers in the first scene, 15 frames each and in scene 2 I do not mind if it repeats.
 
I think I understand now... you need a stop action on frame 1 of scene 1

then when the button is clicked it wioll take the user to scene 2 frame 1 and play.

correct? Ya' Gotta Love It!
sleepyangelsBW.jpg
 
The easiest way to handle action script within frames is to create a separate layer called "actions". This is where you would put all your stops and any other script you have. Ya' Gotta Love It!
sleepyangelsBW.jpg
 
Yes. I have condensed scene 1. in layer 1 I have text, in layer 2 I have the button. In scene 2 I have what I want to play when the button is clicked. I have put top in layer1 of "text, and my "goto" command is in layer two but it still won't go..It just stopson the screen with the text and the button there...the button fuctions but takes me nowhere.
 
Add a third layer in your scene 1. It's allways a good pratice to have an actions layer only anyway.
Select the last frame of this new layer and press F6, to insert a key frame. Double-click this keyframe and insert a stop action. The code on the button should remain the same.

on (release) {
gotoAndPlay ("scene 2", 1);
}

Although make sure "scene 2" is exactly the same (capital letters and all spaces... etc.) as your Scene 2's name.
scene 2 is not the same as Scene 2!

So, your movie will play Scene 1 and stop on the last frame. If the user hits the button, it should go on playing Scene 2.

Now if you don't mind Scene 2 looping, you will still have to add an action to that effect, otherwise when it ends and if you have no stop action on the last frame, it will start playing Scene 1 again!

Here also you should add an actions only layer. Insert a keyframe on the last frame, and add a goto action, looping back to frame 1, but of Scene 2, as:

gotoAndPlay ("Scene 2", 1);

Regards,
new.gif
 
Thsi is frustrating....I have it exactly the way you told me and it will not go to scene 2....It will stop..but wont go on to scene 2.
 
Send me your .fla at oldnewbie@hotmail.com, or post a link to it!

Regards,
new.gif
 
You simply have your release action on a Frame Actions keyframe and not on the button itself.
Delete that on release action you have on your "new button" layer. Right-click your button on stage which will bring up the Object Actions window, that is where you should set your on release action.
Works fine for me!
But as I said also, since you don't have a loop action or stop action on your scene 2, when it's over, it loops back to Scene 1 again and stops! If you want it to continue looping, you should add a gotoAndPlay ("scene 2", 1); on the last frame of scene 2, but this time, rightly in the Frame Actions window, since this is no longer a button thing!

Regards,
And might I be blessed with your vote!
new.gif
 
Thanks a ton!!! Works fine. You guys are great to have around. Drinks on me tonight!!!! Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top