I want to link some images into a swc library in pure actionscript 3 - is this possible?
+1
A:
Absolutely:
1) in flash import the images to the library
2) export them for runtime sharing and give them class names
3) compile the project to a swc.
4) import the swc into your flex project and access the images by class name like you would any other class in an swc.
greg
2009-11-13 19:04:25
This is not "pure" Actionscript! This involves using Flash.
TandemAdam
2009-11-13 21:57:59
+1
A:
You can use the [Embed]
tag to embed images (and any other data) in pure actionscript.
This is how I embed images for use as a BitmapData.
[Embed(source="/Path/To/MyImage.jpg")]
private static var _myImage:Class;
protected static var myImage:BitmapData = new _myImage().bitmapData; // instantiate embedded class
The final line is not required, but it means you can start using the embedded BitmapData straight away.
To bundle it all into an SWC (if you're using Flash), enable "export to SWC" in the Publish settings.
aaaidan
2010-06-08 02:12:05