I’m trying to convert an old AS 2.0 file to 3.0, but keep getting this error:
WARNING: Actions on button or MovieClip instances are not supported in ActionScript 3.0. All scripts on object instances will be ignored.
import fl.transitions.easing.*;
import gs.TweenLite;
import gs.easing.*;
var targetx:int = 0;
var targety:int = 0;
var speed:int = 0.40;
function easeContent(event:MouseEvent):void {
switch (event.currentTarget.name) {
case "Button_1" :
TweenLite.to(content_mc, speed, {x:0, y:0, ease:Quint.easeOut});
//trace("Button_1");
break;
case "Button_2" :
TweenLite.to(content_mc, speed, {x:-765, y:0, ease:Quint.easeOut});
break;
case "Button_3" :
TweenLite.to(content_mc, speed, {x:0, y:-504, ease:Quint.easeOut});
break;
case "Button_4" :
TweenLite.to(content_mc, speed, {x:-765, y:-504, ease:Quint.easeOut});
break;
default :
TweenLite.to(content_mc, speed, {x:0, y:0, ease:Quint.easeOut});
}
}
for (var i:int = 1; i <= 4; i++) {
MovieClip(getChildByName("Button_" + i)).buttonMode = true;
MovieClip(getChildByName("Button_" + i)).addEventListener(MouseEvent.CLICK, easeContent);
//MovieClip(getChildByName("Button_" + i)).addEventListener(MouseEvent.MOUSE_OVER, _onMouseOver);
//MovieClip(getChildByName("Button_" + i)).addEventListener(MouseEvent.MOUSE_OUT, _onMouseOut);
}
I’ve been pulling my hair out trying to find the problem spot. Can someone take a look at this file and find where the problem lies?
NOTE: the file needs to be updated to use strings within the Case statement: “Button_1”, etc.