PDA

View Full Version : this script is working in actionscrip2.0 but this is not wroking in as3



srsh.sundaram
November 25th, 2007, 11:56 PM
hi all,

I working long time in actionscript 2.0. just now i started working in action script 3.0. The script what i have pasted down is working in as2.

stop();
click_btn.onPress = function() {
gotoAndPlay(1);
};

But the same script is not working in as3.

I don't know y.please tell me.

And also tell what is the differents between actionscript2.0 and actionscript3.0

glidealong
November 26th, 2007, 12:39 AM
this code wont work in as3 since you will have to add event listeners specifying method closures in respose to the event. to make the code work you will have to write


click_btn.addEventListener(MouseEvent.MOUSE_DOWN, OnPress);

function OnPress(e:MouseEvent):void{
gotoAndPlay(1);
}