1
votes

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

1
Can you be more specific as to the Flash symbol and AS Linkage and the relation to the class you are instantiating? - Jason Sturges
Hi Jason, I've edited the question with a screenshot of my export settings. - user573117
Flash Builder clearly has the SWC you published from Flash of this TitlePopup class? Also, you don't have the TitlePopup in code in your Flash Builder project, as you should load it with view as published from Flash Pro's SWC? - Jason Sturges
Yep, the swc is added to the project's library build path. I don't understand your second question... - user573117
Flash Pro uses TitlePopup as the base class. So, you have code of the TitlePopup class. If that code exists in your Flash Builder project as well as the SWC you published from Flash Pro, there's a duplicate definition. One definition is Flash Pro with UI and code, and one is only Flash Builder's code. Make sure your Flash Builder project does not have the code of TitlePopup - only reference that class from Flash Pro's SWC. - Jason Sturges

1 Answers

8
votes

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