Embedding a bitmap at compile time
package {
import flash.display.*;
import flash.events.*;
import mx.core.BitmapAsset;
[Embed(source="photo.jpg")]
public class Main extends Sprite {
private var Photo:Class;
public function Main( ) {
var photo:BitmapAsset = new Photo( );
addChild(photo);
trace(photo.bitmapData.getPixel(0, 0));
}
}
}
Related examples in the same category