# Simple problem

**URL:** <https://forum.kirupa.com/t/simple-problem/3636>\
**Category:** flash\
**Created:** [January 15, 2002, 9:54pm UTC](https://forum.kirupa.com/t/simple-problem/3636 "2002-01-15T21:54:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 15, 2002, 9:54pm UTC](https://forum.kirupa.com/t/simple-problem/3636/1 "2002-01-15T21:54:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 15, 2002, 10:04pm UTC](https://forum.kirupa.com/t/simple-problem/3636/2 "2002-01-15T22:04:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 15, 2002, 10:13pm UTC](https://forum.kirupa.com/t/simple-problem/3636/3 "2002-01-15T22:13:07Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 15, 2002, 10:18pm UTC](https://forum.kirupa.com/t/simple-problem/3636/4 "2002-01-15T22:18:28Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 16, 2002, 8:28am UTC](https://forum.kirupa.com/t/simple-problem/3636/5 "2002-01-16T08:28:47Z")

</div>

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.
