COMMUNITY

Getting a "Null Object Reference" when referencing a child - only for windows target

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?

You mention using a swf file on html5 and windows, so I assume you’re using OpenFL?

If you are you’ll get much better support at their forum https://community.openfl.org/,
since this is a general haxe forum we may not have enough openfl users for your question.

If you are not, then which library are you using?

Ah sorry! yea I am using OpenFL.
I’ll take it to their forums. Thanks!

No problem :wink:
Don’t hesitate to post here if you have general haxe questions or want to showcase a haxe project or library.