flex加载一个swf组件并调用其方法

加载一个swf组件并调用其方法

 

var loader: Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHander);
loader.load(new URLRequest("a.swf"));


private function completeHander(event: Event): void
{
  var loader: Loader = event.target.loader as Loader;
  var movie: MovieClip = (loader.content as MovieClip);
  if (movie != null){
      movie.a_btn.text = "abc";
  }  
}

你可能感兴趣的:(Flex)