I’ve reported the bug in the openfl/swf git repository, but to make it more visible to google (so others doesn’t have to waste time googling like I did) I’m posting it here as well.
Generating the classes for the “Export to Actionscript” elements, is not working when exporting for Flash.
class Main extends Sprite
{
private var swfData:MovieClip;
public function new()
{
super();
swfData = new MainChild(); // This does not work on flash player
swfData = Assets.getMovieClip ("Assets:assets.MainChild"); //This works on flash player
addChild(swfData);
}
}
I’ve made a simple test project so you can check what is happening:
class Main extends Sprite
{
#if flash
private var swfData:MovieClip;
#else
private var swfData:MainChild;
#end
public function new()
{
super();
swfData = cast Assets.getMovieClip ("Assets:assets.MainChild");
addChild(swfData.firstChild);
}
}
Setting the html5 target on the top menu of flash develop, you enable the auto completion, and when you need debugging with breakpoints you build for Flash.