0
votes

Am new to flash builder (well am actually new to flash in general, just started developing for it a few months ago).

Anyways I just wanted to ask:

1) Is there a way to add swc files after the project is created

2) And is there a way to link some of assets in those swc to classes (for example link a ball asset to a class the implements its functionality. You can do that directly from flash pro CS5.5, but is there a way to do it in flash builder)

Am sure those questions may seem trivial but I couldn't find anything about them

Thanks in advance

2

2 Answers

2
votes

1) Yup, go to the project settings: right-click the project, select "Properties" from the context menu, go to the "Flex Build Path" tab, switch to the "Library Path" tab, you'll have the tools to manage libraries linked to the project there.

2) I understand your question as if you wanted to link the symbol to the newly created class. The answer is - it depends on the kind of symbol we are talking about.

  • Vector graphics (that would be some sort of Shape / Sprite / MovieClip) - yes. You simply define a new class with the same name as the class that was previously linked to the symbol. However, there may be problems with embedded video or sound, you would need to check this on the case by case basis, newer SDKs support more of these, but there are known bugs too.
  • Fonts - difficult to say, there are too many different ways of creating / embedding fonts. Some are possible to re-link, some aren't originally linked to a class, and thus are impossible to re-link.
  • Sounds and bitmaps - this is similar to fonts, you may eventually create a flash movie that doesn't create a class for a symbol, otherwise you can simply override the class already linked to the symbol. Otherwise, it should be possible to extract the SWF from the SWC, and use [Embed(source='library.swf', symbol='symbolName')] kind of embed. AFAIK, only MP3 sounds can be embedded in this way.
  • Whatever was embedded as binary asset will have a class linked to it. Overriding that class with your own class extending ByteArray should certainly do the job.
  • Embedded videos - to my best knowledge you cannot re-link them using Flex compiler.
0
votes

I second wvxw's answer.

Another way to add an swc to the project is:

Simply copy the swc into the libs folder of the Flash Builder project.