Friday, March 26, 2010

onRollOut problem

Hey all,



I've made a button_mc with an ''_off'' , ''_over'' and ''_out''
state (works fine)

I've also made the onRelease state gotoAndPlay(''_out'') state
as well so when clicked

it doesn't just jump back to the off state looking jerky but
a little more smooth.



Problem is when I rollOut of the button_mc it after
''clicking'' the button it jumps to the ''_out'' state again.

I want to put an if () statement in the onRollOut function
but don't know how to

code it. Here is my first try but I dont' know what would be
the correct coding for it.



Thanks for any ideas,

skyonRollOut problem
You can't use button_mc.gotoAndPlay(''_out'') == true to test
for anything, because gotoAndPlay is a function.



Instead, you can use button_mc._currentframe to test the
current frame number. Which means you'd have to find out the number
of the frame that you have the ''_out'' label attached to... then use
that number as follows (say ''_out'' falls on frame 4).



if (button_mc._currentframe != 4) {

button_mc.gotoAndPlay(''_out'');

}



No need for the ''do nothing'' statement.onRollOut problem
Thanks for the help.



I didn't work on the ''_out'' state but on the ''_up'' state on
frame one

since I had clicked on it and it would loop through the
''_out'' state back

to frame one.



Works Great. I didn't know about _currentframe. Now I do.



Thanks for the help

No comments:

Post a Comment