Button action script 2

Button action script 2

Post by grundgegu » Sat, 12 Jun 2004 11:04:33


Well i got the button action script to where it didnt get any errors, but now i
have a new problem.
When i test my movie, and click on a button, the link doesnt take me to where
i want to go, say like scene 2, frame1.
If the button was on scene 1 and i click it, the link would just take me back
to scene 1, even though the action script says scene 2, frame 1. Does anyone
have any suggestions? Sorry for havin so many problems.
 
 
 

Button action script 2

Post by grundgegu » Sat, 12 Jun 2004 11:04:38

Well i got the button action script to where it didnt get any errors, but now i
have a new problem.
When i test my movie, and click on a button, the link doesnt take me to where
i want to go, say like scene 2, frame1.
If the button was on scene 1 and i click it, the link would just take me back
to scene 1, even though the action script says scene 2, frame 1. Does anyone
have any suggestions? Sorry for havin so many problems.

 
 
 

Button action script 2

Post by Jecky » Sat, 12 Jun 2004 11:15:53

1) do not VER use scenes for navigation .. do not use scene names in
gotoAndPlay, do not use nextScene or prevScene actions. Instead use frame
labels.

2) once you've fixed your script to not use scenes, if it still has
problems, please show your script here.
 
 
 

Button action script 2

Post by cypherdo » Sat, 12 Jun 2004 11:31:45

That's the type of problems you run into with scenes....just a good Idea to
stay away from them if you're going to do any sort of playhead skipping type
scripts.....

I'd suggest working with labels, or just getting rid of scenes all together.
 
 
 

Button action script 2

Post by grundgegu » Sat, 12 Jun 2004 11:40:51

can you be a little more specific. im a real novice at this stuff. what are labels? and how do i get rid of scenes?
 
 
 

Button action script 2

Post by grundgegu » Sat, 12 Jun 2004 11:42:39

Can you be a little more specific. im a real novice on this stuff.
 
 
 

Button action script 2

Post by Jecky » Sat, 12 Jun 2004 11:46:45

well .. a quick search on this forum in google will turn up HUNDREDS of
posts with people asking exactly the same questions that we answer over and
over and over again.

select a frame in your timelines, give it a label in the properties panel.
use that label in a _root.gotoAndPlay("label") (i.e.. change the word label
there to be whatever label you decide to use)
 
 
 

Button action script 2

Post by cypherdo » Sat, 12 Jun 2004 11:48:58

Well the way the flash compiler interprets scenes is like this

Lets say SCENE 1 has 50 FRAMES
and SCENE 2 has another 100 FRAMES..

Well the flash compiler just take both scenes and makes them one scene with
150 frames.

So you tend to have problems with gotoAndPlay because of bugs.

I'd suggest putting all your animations and movieclips spanning across
multiple scenes into just the first scene.

You can make labels on your frames by inserting a blank keyframe ( perferably
on another layer called labels) and then click it , go to the properties
window, and in the frame input box ( <frame label>) type a name you want to
give that frame.

Than use
gotoAndPlay("nameoflabel");
to go to the label name. This is usually better, because you can add frames
without getting your "gotoandplay's out of synch'

hope that helps a little
good luck
 
 
 

Button action script 2

Post by cypherdo » Sat, 12 Jun 2004 11:50:25

Dude he double posted, we're both answering his question twice, and in the same way...lol
 
 
 

Button action script 2

Post by grundgegu » Sat, 12 Jun 2004 12:18:02

yes this worked, and is somewhat easier to me. thanks again. -andrew
 
 
 

Button action script 2

Post by grundgegu » Sat, 12 Jun 2004 12:20:43

ya i did double post, my bad. and i did what u said and thanks for the help. - andrew
 
 
 

Button action script 2

Post by privatenew » Sat, 12 Jun 2004 20:14:06

heres the technote on this:


http://www.yqcomputer.com/
 
 
 

Button action script 2

Post by newbie_nee » Sat, 12 Jun 2004 20:44:50

Mr. Lewis helped me with ur problem, i think.

I use this:

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

just write scene name EXSACTLY as it is case is sensitive i think.
 
 
 

Button action script 2

Post by tralfa » Sun, 13 Jun 2004 04:39:50


That will work on simple movie but you will be frustrated when you use it on
a more complicated movie because it malfunctions very often. It is brought
up on this forum time and again.. "why doesn't this work...
gotoAndPlay("Scene 2", 1);" Answer.. because you are not supposed to do it
that way.. it can't be trusted. Use frame labels instead.
gotoAndPlay("anyFrameLabel"); Then it doesn't matter what scene that label
is in, it still works.
tralfaz