all groups > flash actionscript > february 2006 >
You're in the

flash actionscript

group:

Setting a variable to a frame with a button


Setting a variable to a frame with a button jdh239
2/26/2006 6:11:17 PM
flash actionscript:
I have a button in urgent_mv layer just below the main timeline. I have a
reset button on the main timeline. I have a variable called URGENT that gets
set to on or off in the urgent_mv. When I have a customer hit the RESET button
on the main timeline I want it to go to a particular frame in the urgent_mv
layer and stop (frame 1 in particular). Anybody know how to do this? I can
set my variable easily enough:
urgent = "no";

I just need it to go and stop on the urgent_mv layer's first frame.

Thanks in advance.
Re: How to gotoAndStop on a frame in a lower level movie clip blemmo
2/26/2006 8:27:28 PM
Try
_level1.urgent_mv.gotoAndPlay(1);

because if the MC is on level 1, as you said, you'll need to specify the level before the MC's name.

hth,
Re: How to gotoAndStop on a frame in a lower level movie clip jdh239
2/26/2006 8:38:27 PM
Hmmm, tried that, but it still didn't work. Here is the source code:

http://www.theyharmonfam.com/download/formfield.fla -- the swf is there too.

Basically, if you look at the swf, you can check the "urgent" box. When you
hit reset I want it to clear.

In the FLA I believe layer 16 contains the reset button. On another layer you
will see the checkbox. Double-click on it and you will see my 2 frames of
stuff.

Hope that helps narrow down why this wont work.

Thanks in advance.
Re: How to gotoAndStop on a frame in a lower level movie clip blemmo
2/26/2006 9:05:33 PM
ok... you just didn't assign an instance name to the MC. If you name it
"urgent_mv" (select the MC on stage and put this in the textfield under
'properties'), then you could use your first code:

urgent_mv.gotoAndStop(1);

Don't use gotoAndPlay, because then you would check/uncheck it every time you
press Reset. ;)

cheers,
blemmo
Re: How to gotoAndStop on a frame in a lower level movie clip jdh239
2/26/2006 9:13:31 PM
AddThis Social Bookmark Button