Note to self. This scenario isn’t mentioned here: http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000343.html
Every single method, unique to XML and XMLList or inherited will be return as an empty XMLList instead of the intended method as a Function when its retrieved as a property of that instance. Note that this not calling XMLList methods but retrieving the actual methods as properties of the objects themselves.
For example:
myXML.contains is XMLList //true
myXML.toString is XMLList //true
This makes it impossible to call a method of an XML or XMLList programmatically via bracket notation like:
myXML['toXMLString']() //returns TypeError: Error #1006: value is not a function.
It feels like a Proxy is involved internally and these methods were not set to returning properly in getProperty. Anyone have any feedback or work arounds?
This is bizarre. It appears the main display object’s graphics object is rendered on Stage and not its own display as in the example above:
In the Actionscript Project published above I have a red square drawn on the graphics of the main Sprite class and a child sprite with a green square and a textfield to the right to trace clicks.
I have MouseEvent.CLICK listeners on stage, main sprite ClickTest, and child Sprite. With mouse children disabled clicking anywhere will report a single MouseEvent.CLICK to stage even though they should be dispatching for both the main display and stage. With mouseChildren enabled the top square will still only trigger the Stage mouse listener but the bottom will correctly trigger the click on the child sprite, main parent ClickTest sprite, and stage showing that the main DisplayObject is participating in the mouse event bubbling.
Thus my conclusion that the main display object’s graphics object is rendered on Stage which can cause a lot of unexpected behavior and confusion. Your root display class cannot listen to its own display to catch mouse events for its own graphics object. I guess this could make enough sense if the root display object shared its display with the root Stage but as this hierarchy diagram shows, it shouldn’t: http://www.adobe.com/devnet/flash/quickstart/display_list_programming_as3/
I’d consider it one of those bizarre architecture inconsistencies like swfs having references to stage in the constructor when ran stand alone but not when they are loaded into another swf, its just inconsistent and asking for trouble?