|
-
Remove onRollOver and have button automatically play
I have some code for a button, I'm trying to remove the onRollOver and onRollOut functions and have it automatically play the button effects.
What do I need to do to just have this automatically play?
Code:
//default size
sizeTo = 100;
//increase the size and play the effect animation when mouse is over the button
onRollOver = function(){
effect.gotoAndPlay(2);
sizeTo = 130;
}
//revert to 100% size when mouse cursor is out
onRollOut = function(){
sizeTo = 100;
}
//dynamically adjust the size of the button
onEnterFrame = function(){
caption._xscale = caption._yscale = caption._xscale+((sizeTo)-caption._xscale)/5;
}
-
Try using the onEnterFrame method.
-
shavingcream incarnate
since ur using a gotoAndPlay, onEnterFrame will make it act like a gotoAndStop, because it will be repeatedly going to that frame, just remove the functions all together, change
PHP Code:
onRollOver = function(){ effect.gotoAndPlay(2); sizeTo = 130; }
//revert to 100% size when mouse cursor is out onRollOut = function(){ sizeTo = 100; }
to
PHP Code:
effect.gotoAndPlay(2); sizeTo = 130;
if you want a way to change the size back, its going to have to be something other than rollOut, because you wont have a rollOver
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|