Copy link to clipboard
Copied
When I create a SWC from a FLA in Flash Pro and then import it into another project, all the functions work properly but the items on the stage are not present.
It must be something simple I am missing.
I do have 'automatically declare stage instances' turned on in both the SWC's FLA and the new project.
Copy link to clipboard
Copied
then import it
How do you import it? Generally the only thing you have to do is linking to the swc in the File>ActionScriptSettings>LibraryPath.
Where do you add the items to the stage (where do you call the actuall addChild() code)?
Copy link to clipboard
Copied
Importing as you mention.
Items in the SWC's FLA are on the stage.. not added.
I add the SWC Class after Initialization.
The functions in the SWC operate. so it is importing correctly that far.. but I cannot see nor access any items on the stage from the SWC.
I have even tried not accessing them until I receive an ADDED_TO_STAGE event.
It is like the objects on the stage are not being included in the SWC.
Copy link to clipboard
Copied
Are you using a class file to set up your swc and at least extending DisplayObject ?
Copy link to clipboard
Copied
Yes and extending as MovieClip.
Copy link to clipboard
Copied
You might find this thread helpful.
The upshot was that the person asking the question was using a SWC where the symbols in the SWC had an AS Class, and they were referencing that Class in the Class field instead of the Base Class field. The reason this was a problem is that, in order to instantiate that same Class, there has to be an import statement and the import statement points directly to the AS file and knows nothing about the library symbol in the SWC and whatever objects you've put there.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now