Wednesday, June 6, 2012

[Action Script] How to set a picture from library to a EventListener? June,2012

I fixed this issue. Thank you guys!

I import a PSD to library and convert it to Movie Clip and Button, but both of them can't work normally. The instance name is sp.
I used a document class for it, the code is below. I tried those code with a button user interface from Flash COMPONETS, it is worked.
I would like to know how to fix this issue, thank you!
ActionScript Code: package  {    import flash.display.MovieClip;    import flash.display.Sprite;    import flash.events.MouseEvent;        public class test extends Sprite{        public function test() {            sp1.addEventListener(MouseEvent.MOUSE_DOWN,click1);        }                private function click1(evt:MouseEvent):void{            trace("1");        }    }    }
How to set a picture from library to a EventListener?

Related Post



0 comments: