actionscript - Can flash.display.Bitmap have events on themself? -


Is it possible or should I do it anyway? The problem is that the event is not responding. [Embed (source = "pic1.jpg")] Private server image 1: class; Var i1: bitmap = new img1 (); // i1.addEventListener is not working (MouseEvent.CLICK, function (e: MouseEvent) {t.htmlText = "Click!";}); As you can see, there is no descendant of bitmap as

Only interactive object can be part of the input process of Flash.

Whatever you want is to include a bitmap with a Sprite:

  [embed (source = "pic1.jpg")] Personal var Img1: Class; Var i1: bitmap = new img1 (); Var s1: Sprite = New Sprite (); S1.addChild (i1); S1.addEventListener (MouseEvent.CLICK, function (e: MouseEvent) {t.htmlText = "Click!";});    

Comments