please could someone help me please as have just started using actionscript and really don’t know much about it
basically it’s a panning thing where a user clicks on a link and the contents of that page scroll onto the screen
I have used this code which is for AS3 but wondering how i could get it to work with AS2
And no this is not a class project
import fl.transitions.Tween;
import fl.transitions.easing.*;
home_btn.addEventListener(MouseEvent.CLICK,panContent);
about_btn.addEventListener(MouseEvent.CLICK,panContent);
contact_btn.addEventListener(MouseEvent.CLICK,panContent);
function panContent(evt:MouseEvent){
var buttonName:String = evt.target.name;
switch(buttonName){
case "home_btn":
new Tween(content_mc,"x",Strong.easeOut,content_mc.x,0,1,true);
break;
case "about_btn":
new Tween(content_mc,"x",Strong.easeOut,content_mc.x,-2048,1,true);
break;
case "contact_btn":
new Tween(content_mc,"x",Strong.easeOut,content_mc.x,-4096,1,true);
break;
}
}
Updated: