Loading a bitmap at runtime : URLRequest : Network Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Network » URLRequest »

 

Loading a bitmap at runtime


 
package {
  import flash.display.*;
  import flash.events.*;
  import flash.net.*;

  public class Main extends Sprite {
    private var loader:Loader = new Loader(  );

    public function Main() {
      loader.contentLoaderInfo.addEventListener(Event.INIT,initListener);
      loader.load(new URLRequest("photo.jpg"));
    }

    private function initListener (e:Event):void {
      addChild(loader.content);
      trace(Bitmap(loader.content).bitmapData.getPixel(00));
    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Network
» URLRequest