displaylist

listening to events down the display list in children components

最后都变了- 提交于 2020-01-07 02:51:26
问题 I'm creating a swf, that has a parent class and a child class. The parent class has a button, that dispatches a custom event and I want the child class to list for this event, but when I dispatch the event the child class does not hear the event has been dispatched. This is the code that dispatches the event: private function onCTAClicked(e:MouseEvent):void { trace("onCTAClicked"); dispatchEvent(new CTAClickEvent(CTAClickEvent.CTA_CLICK_EVENT,true)); } And the listener is registered like this

Actionscript Receiving Mouse Events For Lower Indexed And Partially Covered Display Objects?

ぐ巨炮叔叔 提交于 2020-01-06 01:06:10
问题 i have 2 sprites on stage. bottomSprite is added to the display list first, followed by topSprite. topSprite partially covers bottomSprite. i've added an event listener to bottomSprite for MouseEvent.MOUSE_MOVED notifications to simply trace the mouseX and mouseY coordinates. however, the notification doesn't work for the parts of bottomSprite that are covered by topSprite. var bottomSprite:Sprite = new Sprite(); bottomSprite.graphics.beginFill(0x666666, 0.5); bottomSprite.graphics.drawRect

AS3 Display list and box2d

一笑奈何 提交于 2019-12-25 04:48:10
问题 I have a function called "brick" inside a subclass called createBrick that extends from the sprite class, also I have a movie clip created in the library exported for runtime sharing called "Brick". For some odd reason when I run the code the brick is not showing up on the stage even though it does get created when I debug the code. here is the function public class createBrick extends Sprite { public function createBrick(_main:Main) { main = _main; var go:Brick = new Brick(); addChild(go);