Question

I've created a class in my Flash Builder Actionscript project.

I then created an FLA with the graphics for that class, made a symbol of it and linked it to the class. Then I published a swc.

If I attempt to use the swc in another fla, and then instantiate the object and add it to the display list, there is no issue.

However, when I run my flash builder project, the graphics of the object don't show up. Though trace statements in the class' constructor function run normally.

What's going on? Pretty sure I had no problem getting this to work in the past. Not sure if I can't remember how to do it or what.

Here are my symbol export settings:

Symbol settings

Was it helpful?

Solution

If the class is defined both in your Flash Builder code base as well as the SWC published from Flash Pro, there is likely a conflict with the package.

Flash Builder

  • Defines base class of TitlePopup
  • new TitlePopup() likely instantiates the class within your Flash Builder project, and does not instantiate the definition with UI published from Flash Pro SWC.

Flash Pro

  • Uses base class of TitlePopup in AS Linkage
  • Defines UI
  • new TitlePopup() instantiates the class with UI defined by Flash Pro as well as the base class AS Linkage code.

Instantiating the class definition from Flash Pro SWC has your UI as well as the base class.

Instantiating from Flash Builder, it is likely using your base class from your codebase and not the class with UI from your SWC.

If the TitlePopup class is published from Flash Pro's SWC, then you should remove that class from your Flash Builder codebase and reference it only from the SWC definition.

flash-swc

If you just want to use Flash Builder as the code editor of Flash Pro, you can always "Edit in Flash Builder" for your classes. Right click your symbol from the library and choose Flash Builder:

edit in Flash Builder

A Flash Builder project is auto-generated for you.

Flash Builder may not resolve Flash Pro's playerglobal.swc, in which you can add the definition in the auto-generated Flash Builder .actionScriptProperties:

<libraryPathEntry kind="3" linkType="1" path="${FLASHPRO_APPCONFIG}/ActionScript 3.0/FP10.2/playerglobal.swc" useDefaultLinkType="false"/>

Likewise if you depend on Flash Pro components, you can add them by SWC.

Windows:

C:\Program Files (x86)\Adobe\Adobe Flash CS5.5\Common\Configuration\ActionScript 3.0\libs\flash.swc

Mac:

/Applications/Adobe Flash CS5/Common/Configuration/ActionScript 3.0/libs/flash.swc

Or, you can add the component source paths:

Windows:

C:\Program Files (x86)\Adobe\Adobe Flash CS5.5\Common\Configuration\Component Source\ActionScript 3.0\User Interface

Mac:

/Applications/Adobe Flash CS5.5/Common/Configuration/Component Source/ActionScript 3.0/User Interface

Perhaps you could create an ActionScript library project in Flash Builder, use that library project as a source path within Flash Pro (not per project, but global source path).

Then publish SWC from Flash Pro, and use the SWC when implementing pure ActionScript projects in Flash Builder.

That doesn't help your unified codebase; however, would also be a workflow to keep all your code in Flash Builder.

flash-source

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top