icod
在Flash安装目录: Adobe Flash CS5\Common\Configuration\Components下有User Interface.fla, 将它发布出一个User Interface.swf.
将这个文件加载到当前应用程序域里:

 

this._loader = new Loader();
this._loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete_loader);
this._loaderContext = new LoaderContext(false, ApplicationDomain.currentDomain);
this._loader.load(new URLRequest("User Interface.swf"), this._loaderContext);
 

加载完成后再做工程的初始化.

这时可以通过以下方式使用这个fla里的组件:

 

var btnClass:Class = getDefinitionByName("fl.controls.Button"as Class;
var btn:DisplayObject 
= new btnClass();
this.addChild(btn);
btn[
"label"= "heee";
 

不过这样用也太繁琐, 不了解组件内部实现的根本没法用.

在Flash安装目录: Adobe Flash CS5\Common\Configuration\Component Source\ActionScript 3.0\User Interface下有fl包放到工程的根目录下, 然后就可以:

 

var btn:Button = new Button();
btn.label 
= "removeProgress";
this.addChild(btn);
 

更改皮肤, 就在User Interface.fla里改好重新发布swf即可. fl包其实只是用来代码提示, 没有实际用途. 因为在swf里已经有了那些实现类.

分类:

技术点:

相关文章:

  • 2021-11-05
  • 2022-01-19
  • 2021-05-26
  • 2021-08-14
  • 2021-04-25
  • 2022-01-19
  • 2021-10-14
猜你喜欢
  • 2021-08-10
  • 2019-12-16
  • 2021-04-16
  • 2021-08-17
  • 2021-07-26
  • 2021-09-08
  • 2021-11-05
相关资源
相似解决方案