A Event Problem


recently,i meet trouble ,below code:
package
{
import flash.display.sprite;
import flash.events.mouseevent;
import flash.display.shape;

public class test extends sprite
{
public function test():void{
this.graphics.beginfill(0xff0000);
this.graphics.drawrect(0,0,100,100);
}
public function clickevent(event:mouseevent):void{
trace("========================================");
}
}
}

in opinion, when clicked rectangle, there print line of "=",but didn't . seems actionscript didn't response mouse event, , don't know why, i'm confused ...

sorry, code upper not correct, below code ,but didn't response mouse event

package
{
import flash.display.sprite;
import flash.events.mouseevent;
import flash.display.shape;

public class test extends sprite
{
public function test():void{
this.graphics.beginfill(0xff0000);
this.graphics.drawrect(0,0,100,100);
this.addeventlistener(mouseevent.click,clickevent);
}
public function clickevent(event:mouseevent):void{
trace("========================================");
}
}
}



More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Authentication error while password reset - Raspberry Pi Forums

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums