2010年8月5日 星期四

[Flex 4] tree control 動態載入外部xml

測試過在flex 4 搭配 asp.net c-sharp 可以work



   [Bindable]
  private var userDataObject:Object; //data object provider for tree control
   [Bindable]
   private var xmlLoader:URLLoader; // used to load URLRequest (URLRequest is used to request XML)
   
   private function initializeHandler():void {
    
    xmlLoader = new URLLoader();
    xmlLoader.addEventListener(Event.COMPLETE, completeHandler);
    var uri:URLRequest = new URLRequest("../user_group.aspx");
    
    xmlLoader.load(uri);
   }
   private function completeHandler(event:Event):void { 
    trace( xmlLoader.data );
   }

   
   private function creationCompleteHandler(event:Event):void {
    
    userDataObject = xmlLoader.data;
    
   }





沒有留言: