Using SWF Assets - Symbolos lose custom class kinship

I have 2 movieclips, one inside the other and both are marked as linked in the library. In my project openfl when i use this swf assets as checking the option generate the haxe classes based on flash pro lib are generated correctly but symbolos lose kinship. The child returns to a MovieClip Instead of returning McChild

Without this possibility the workflow is not the same as the flash . This is the main feature that makes always made ​​the flash programmers love working with this technology.

By code you lose too much time managing the relationship and positions of parents and children of the symbols . The ability to automatically transform children in custom classes is extremely efficient and necessary , especially in projects that require design of constant change .

my FLA settings and Flash developer code:

If you compile for Flash, this might work. Besides that, there’s no way to access the custom AS3 classes in your SWF.

If you want cross-platform classes, write them in Haxe.

You did not understand. I do not want the OpenFL generate AS3 classes. I want the HAXE classes that were generated from library FLASH PRO maintain kinship between their instances.

And yes there is a way to convert and access custom AS3 classes. See the second image of my post , the McCont and McChild calsses are converted HAXE classes and you can add methods and propriadades them in haxe. :neutral_face:

Problem is, once Flash Pro generates a SWF, the classes aren’t Haxe classes anymore. They’re now AS3 bytecode, and the only language that can interact with them is AS3.


What if you tried a different tactic? Instead of trying to compile the classes into the SWF file and still use them, just use the SWF for graphics and layout, and attach the classes at runtime.

By “attach the classes,” I’m saying to take the MovieClip object that’s already there, and add it as a child of your McCont class. Then look through the children of the MovieClip, and create a McChild object for each one.

I know it’s not the ideal solution, but it might be your best option.

Yes I know. I can do this dynamically in haxe. But this way I’ll lose all the advantage of creating assets with Flash Pro. It does not seem complicated openfl maintain the relationship between the symbols. The most difficult is already done (custom library classes in flash pro are being converted to haxe).

What I want is simple: Keep the relationship between symbols in haxe code.

Oh, I missed the part where the Haxe code was generated by the SWF library. I assumed that was still a ways off.

The library mentions that generate="true" is still in beta. I’m guessing that what you’ve seen so far is all it does. In other words, I’m guessing that it generates those Haxe classes, but doesn’t link them together in any way.

What you’re looking for should be possible (kind of). The implementation would be something like what I described above, except that the code is automatically generated. Only problem is, the generator doesn’t do this yet.

Open a feature request and see how much support it gets. Unfortunately, even with enough support, I wouldn’t count on it being implemented soon.