Skip to main content
Known Participant
February 14, 2013
Question

SWC usage - stage items not available

  • February 14, 2013
  • 2 replies
  • 1033 views

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.

This topic has been closed for replies.

2 replies

Amy Blankenship
Legend
February 15, 2013

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.

Inspiring
February 14, 2013

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)?

DachFlachAuthor
Known Participant
February 14, 2013

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.

Inspiring
February 14, 2013

Are you using a class file to set up your swc and at least extending DisplayObject ?