Hi, I made a class that extends a movieclip from an swf. That gives me access to all the named displayobjects in that movieclip, which is great. compiling that for HTML5 and Flash works well, but I get this “Null Object Reference” alert when I target it for windows.
So when tracing the child it gives me null for the windows target.
but [object MovieClip] for the HTML5.
and [object somechild] for the Flash target.
I could just use getChildByName(“somechild”) but the dynamic access is pretty nice.
Is it possible to achieve this for windows?
I just found this only happens for movieclips with code in their timeline. Even a single // cause the reference to fail. Here’s a small example.
Open fla/lib.fla and open Symbol from the library, click the child (red circle) and see the // in its timeline.
Open the project (I’m using FlashDevelop), target windows, run it, and see it trace null.
ah okay, that’s strange. in any case I don’t think the swf is an empty object. When I try this: trace(new Symbol().child); (where Symbol is the class from the swf)
and there’s no code in the child’s timeline I get a proper [object MovieClip] back.
But the moment I put just // in its timeline it returns null, only on the windows target.