July 12th, 2008

  • Flash

Working with Embedded Assets in AS3

I've been working with embedding SWFs in a pure AS3 project using the Flex 3 IDE and I ran across a little problem. All the examples just embed a SWF or JPG and use them directly on the stage. While this is fine for most instances, I needed to change the value of the TextField in my symbol. Embedding just a SWF won't allow you to do this. You have to use a symbol within an embedded SWF. All you pretty much have to is add the symbol property into the metadata line, like so.

[Embed(source="assets/icon.swf", symbol="number")]
private var Icon:Class