Mouse click listener on the shape doesn't work in actionscript 3.0 -
could me please issue: have created shapes , have putted mouse click listener on them same listener function, function doesn't called.
shape:shape = new shape shape.graphics.beginfill(color); shape.graphics.drawroundrect(rx, ry, cwidth, cheigth, ellipseheight, ellipseheight); shape.graphics.endfill(); shape.addeventlistener(mouseevent.click, onmouseclick); areasprite.addchild(shape); private function onmouseclick(ev:mouseevent):void { // code .......... } what i'm doing wrong here ? me ?
shape objects non interactive, not fire mouse events, etc.
instead of using shape, use object inherits interactiveobject. sprite may option.
but, if doing graphics object, declare object movieclip.
shape:sprite = new sprite(); or
shape:movieclip = new movieclip(); look @ inherited events shape here; http://help.adobe.com/en_us/flashplatform/reference/actionscript/3/flash/display/shape.html
... , compare inherited events sprite here; http://help.adobe.com/en_us/flashplatform/reference/actionscript/3/flash/display/sprite.html
Comments
Post a Comment