flex图片加载问题

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
<mx:Script>
 <![CDATA[
  import mx.controls.SWFLoader;
     private var loader:SWFLoader;
   
    private function init():void
    {
     loader=new SWFLoader();
     loader.source="comload.swf"
     this.addChild(loader);
     loader.visible=true;
     loader.x=100;
     loader.y=100;
    }
  
  private function clickHandle(e:Event):void
  {
   myImg.addEventListener(Event.COMPLETE,completeHandle);
   myImg.source="http://www.siyuroom.com/album/myCamera/20091212185738.jpg";
  }
  private function completeHandle(e:Event):void
  {
   loader.visible=false;
  }
 ]]>
</mx:Script>
 <mx:Image id="myImg" x="0" y="0"  width="593" height="399"  creationComplete="clickHandle(event)"/>
</mx:Application>

    A+
发布日期:2009年05月17日  所属分类:未分类

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: