Load a picture : URLLoader : Network Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Network » URLLoader »

 

Load a picture


 
package
{
    import flash.display.Sprite;
    import flash.display.Loader;
    import flash.net.URLRequest;
    import flash.events.Event;
    public class Main extends Sprite
    {
        private var loader:Loader;
    
        public function Main()
        {
            loader = new Loader();
            loader.load(new URLRequest("image.jpg "));
            loader.contentLoaderInfo.addEventListener(Event.COMPLETE,  
                contentComplete);
            addChild(loader);
        }
    
        private function contentComplete(event:Event):void
        {
            trace(loader.content);
        }
    }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Network
» URLLoader