Creating a named instance of a runtime shared movieclip inside of a MC that is itself RTS (1046)
Hello,
We are creating UI for video games in Animate. That's right! We would like to have nested runtime shared library items. What I mean by that is:
A.fla defines some movieclip "share1", which is marked for export for runtime sharing.
B.fla imports "share1" as runtime shared from A.swf, and creates an instance of it in a movieclip called "share2", which is also marked for export for runtime sharing.
C.fla imports "share2" from B.swf.
We are doing this so that the "share1" moveclip can be used in many files. Let's say it is a set of icons. (it is a set of icons.)
Now, this is fine up until you give the instance of "share1" that is inside "share2" a name, let's say we call it "icon". Obviously we do this so that in the game we can reference it by name and move the timeline to the desired icon frame.
At this point, B.fla fails to publish, with error 1046: "Symbol 'share2' 1046: Type was not found or was not a compile-time constant: share1."
This scenario can easily be reproduced in a single Flash file.
- Create a new Flash file.
- Create a new movieclip library object.
- Call it "imported_icons". We are imagining importing some icons.
- Check "Import for runtime sharing" and enter anything in the filename field. I used "fantasy_icon_file.swf". We are imagining the icons are exported to that swf for runtime sharing, but it doesn't matter because we will never get to runtime.
- You will be asked if you want to continue editing the object, since it is imported. Click no. You do not want to.
- Create another new movieclip library object.
- Call it "exported_icon_usage". We are imagining an object that uses the icons for something.
- Check "Export for runtime sharing". It doesn't matter what file you export it to; I used "fantasy_icon_usage_file.swf".
- Hit ok.
- You should now be editing the new icon usage movieclip. Drag "imported_icons" into the field.
- If you save the flash file and publish it now, it should go fine.
- Select the imported_icons movieclip instance and give it an instance name, let's say "icon", since it shows one icon, not many.
- Now if you try to export again, you will receive error 1046.
Here is my question: how can we make this idea work?
Is it fundamentally not possible in Flash, or is it that we have not set up our Scene/Library/Flash/AS environment correctly?
Many thanks for reading. I hope somebody can help. I have gone ahead and created a flash file matching the example steps above, but this form will not allow me to upload it. I am sorry. It does not take long to reproduce locally.
Thank you.
Alex
