/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
package { import flash.display.Sprite; import flash.display.BitmapData; import flash.display.Bitmap; class EmbeddedImageExample extends Sprite { [Embed(source='photo.png')] private var photoClass:Class; private var photo:Bitmap; function EmbeddedImageExample() { photo = new MyPhoto(); var bmp:BitmapData = photo.bitmapData; } } }