The code below creates a smooth movieclip button in AS 3. Is there anyway to do this so you don’t have to specify your tween in your actionscript?
import fl.transitions.Tween;
import fl.transitions.easing.*;
var startWidth:Number = green_mc.button_mc.width;
green_mc.buttonMode = true;
green_mc.addEventListener(MouseEvent.ROLL_OVER, buttonOver);
green_mc.addEventListener(MouseEvent.ROLL_OUT, buttonOut);
function buttonOver(e:MouseEvent):void
{
new Tween(e.currentTarget.button_mc, “width”, Strong.easeOut, startWidth, startWidth+100, 8, false);
}
function buttonOut(e:MouseEvent):void
{
new Tween(e.currentTarget.button_mc, “width”, Strong.easeOut, e.currentTarget.button_mc.width, startWidth,8,false);
}**
In AS 2 you would just apply the below Actionscript 2.0 to the movieclip:**
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.nextFrame();
} else {
this.prevFrame();
}
}
Basically is there an equivalent code in AS 3 for the AS 2 code above?
I hope that question makes sense.
Thanks for your help!