Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

SWC usage - stage items not available

Explorer ,
Feb 14, 2013 Feb 14, 2013

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.

TOPICS
ActionScript
991
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Feb 14, 2013 Feb 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)?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 14, 2013 Feb 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Feb 14, 2013 Feb 14, 2013

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 14, 2013 Feb 14, 2013

Yes and extending as MovieClip.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Feb 14, 2013 Feb 14, 2013
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines