
Much like the authors of the original Bible, we authors of the ActionScript 3.0 Bible have caught a lot of heat over discrepancies in our book. Unfortunately, working with several co-authors has its drawbacks and I am not able to take full responsibility for all of the content. If you find problems or are having trouble compiling your code, I encourage you to please visit the Wiley website to check for corrections and to fill out the errata form. The publisher will be better able to coordinate with the right people to fix any issues.
Please accept our apologies for the errors you’ve found so far.
Mims
Reader Question: Why isn’t event bubbling working
By Mims Wright | on March 18, 2008
In AS3, AS3 Bible, Authors, Flash, Programming | No Comments
A reader sent me this question. Thanks in advance to Michael:
i’m dispatching an event from a sprite after it fades in completely
dispatchEvent(new Event(Main.ENTER_SCREEN_COMPLETE));i’m trying to listen for to this event but for some reason it doesn’t get picked up when the capturing parameter is set to false.. that is for bubbling and the target phase.
This works
container.addEventListener(Main.ENTER_SCREEN_COMPLETE, screenTweenComplete, true, 0, true);This does NOT work
container.addEventListener(Main.ENTER_SCREEN_COMPLETE, screenTweenComplete, false, 0, true);Where container, is an ancestor to everything on the screen. Essentially its the the stage.
Any clues why this is happening?
Answer after the jump.
Continue reading Reader Question: Why isn’t event bubbling working…
No children on the stage - a confusing Flash CS3 display list issue
By Mims Wright | on January 15, 2008
In AS3, AS3 Bible, Flash, Programming, Tutorial | 2 Comments
A reader wrote to me with an interesting Flash CS3 problem that had me stumped at first (mostly because I use FlexBuilder instead of Flash). I thought I’d post the answer here so we can all benefit from it.
The Problem
Ben H. writes…
I’ve been trying to get familiar with a “best practice” on [looping through the display list]. The trouble is, when I enter the following on the first frame of a blank .fla file:
trace("Number of Children in a blank SWF:"+stage.numChildren);
trace("Child 1:" + stage.getChildAt(0));I get this:
Number of Children in a blank SWF:1
Child 1:[object MainTimeline]Now that may seem grand, but I’ve drawn several shapes and have a text field and named movieclip instances on stage as well – so why [does it only count one child?]
Solution after the jump.
Continue reading No children on the stage - a confusing Flash CS3 display list issue…