Simple problem

I’m kind of embarrassed I’m having trouble with this, but I guess I’m still just a Young Flash Padwan…

I’m trying to use switches in a Flash project I’m working with right now, but in the process I’ve discovered that either there’s something I don’t know about setProperty, if, or both.

The first thing I wrote was for a button’s actions:

on (release) {
&nbsp &nbsp &nbsp &nbsp set ( dog, 1 );
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp gotoAndPlay (2);
&nbsp &nbsp &nbsp &nbsp }

… and then on frame 2 it transists until frame 10 where, for the frame’s actions, I typed:

if (dog == 1) {
&nbsp &nbsp &nbsp &nbsp gotoAndPlay (“Film”, 1);
}

… but for some reason it just goes back to frame 1 in the same scene.

Thanks in advance.

You should try something, a simple debug :
put another layer in your movie, and in the first frame put a dynamic text zone called test. Go to the frame where you test if dog ==1, and press F5 so that the text zone stays there during the whole process.
Now in the first frame of that layer, put the action test = dog ;

You’ll see if your variable dog really transits where you want it to.
And why don’t you write dog = 1 ; instead of (set (dog,1) ; ?
Last but not least, do you use at any point a movie clip ? Where’s your animation ?

pom

  1. Initially I had dog = 1 but I changed that because it wasn’t working. I just wrote up the one I had at the time.

  2. I use movie clips as buttons and for a little character pointing at said buttons, but that’s it.

  3. I’ve tried debug. The variable’s being ignored completely. Something must be blatantly wrong with my code…

I just had two lines of code misplaced. It was a simple stupid mistake. At least I don’t have to feel bad about my lack of flashibility over it, and instead just my ability to goof up every now and then…

We all do that. If I had a dime for every semi-colon I’ve left out of my code the first time through, I’d be a rich man.