- 浏览: 39435 次
- 性别:
- 来自: 珠海
最新评论
[1b]关于 Coding ActionScript 3.0系列
[/1b]
我打算开始转入AS3的开发,之前的AS2代码将逐步转移过来,在编码过程中可能获得一些有价值的信息,我将和大家一起分享和讨论。有更好的建议,也可以在这里提出来。我不保证我采用的方法是最好的,也不保证代码没有任何问题,应此,在使用我的代码产生的任何问题,我都不负责。同时,请注意,不要将这些代码用于商业用途,如果必须,请与我联系。
[1b]Loader [/1b][1b][/1b]
在AS2中加载外部swf文件一般都用MovieClipLoader对象,在as3中则需要采用Loader比较方便。Loader继承DisplayObject,因此,你可以直接在一个DisplayObject中采用addChild方法加载进来:
var loader:Loader = new Loader();
this.addChild(loader);
但是,这样你加载进来的是一个Loader,而不是Loader对象Load进来的swf,因此,你需要采用这样的方式:
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.load(new URLRequest("lib.swf"));
function completeHandler(event:Event){
var _content:DisplayObject = event.target.content;
this.addChild(loader);
}
此外,需要注意,你无法直接监听loader对象来获取文件是否加载完毕。需要采用
loader.contentLoaderInfo。
点击下载原文件
本文转自:http://www.5uflash.com/flashjiaocheng/Flash-as3-jiaocheng/1961.html
发表评论
-
Flash进度条的制作详细讲解(组图)
2010-04-10 13:31 557在论坛和其他网站上经常可以看到新手请教如何制作FLASH进度条 ... -
loding完美制作
2010-04-10 13:31 728当然这里的"完美loding"是指lond ... -
loding完美制作
2010-04-10 13:30 538当然这里的"完美loding"是指lond ... -
Flash中加载影片时,Loading的位置对影片的影响
2010-04-10 13:30 862在论坛经常看到Loading加载方式的探讨,不过大多都是讨论 ... -
Flash中加载影片时,Loading的位置对影片的影响
2010-04-10 13:30 766在论坛经常看到Loading加载方式的探讨,不过大多都是讨论 ... -
AS3笔记(9)-Array
2010-04-09 13:56 585首先值得一提的是AS3的 Array 有了像 String 一 ... -
学习As2.0与AS3.0的尴尬
2010-04-09 13:56 713从macromedia大刀阔斧对A ... -
学习As2.0与AS3.0的尴尬
2010-04-09 13:56 551从macromedia大刀阔斧对A ... -
探索As3.0 Preview
2010-04-09 13:55 479[1b]声明:[/1b]本教程英文版源自Adobe的: htt ... -
探索As3.0 Preview
2010-04-09 13:55 457[1b]声明:[/1b]本教程英文版源自Adobe的: htt ... -
【as3】ActionScript 3.0体验试教学视频教程
2010-04-09 11:45 407很不错的视频教程 原文地址: http://blog.sina ... -
as3 使用sound类(翻译)-暂停和继续播放声音
2010-04-09 11:45 634[1b]问题十[/1b] 如何暂停声音,如何从暂停的地 ... -
Coding ActionScript 3.0系列[3]外部swf文件载入
2010-04-09 11:45 654[1b]关于 Coding ActionScript 3.0 ... -
Coding ActionScript 3.0系列[4] 外部swf库资源载入及使用
2010-04-09 11:44 617[1b]关于 Coding ActionScript 3.0 ... -
指针随鼠标移动的flash卡通时钟
2010-04-08 11:17 561。先看下时钟效果: var fnum:Number = ... -
动画人物运动规律与节奏
2010-04-08 11:17 580本文转自:h ... -
Flash绘制美丽风景画之海滩
2010-04-08 11:17 460过前段时间学习,我们掌握了鼠绘的一些初步知识,今天我们来综合一 ... -
Flash制作卷轴水墨画展开动画效果
2010-04-08 11:17 546北京奥运会开幕式上那充满诗意的卷轴,以及它所呈现给我们的一幅幅 ... -
Flash鼠绘入门第十三课:绘制美丽春日飞燕
2010-04-08 11:17 539相传燕子于春天社日北 ... -
跑动的小火柴人(flash动画)
2010-04-08 09:32 467本教程描绘的是完全用ActionScript做的一个火柴棍小人 ...
相关推荐
ActionScript 3.0, the latest version of the Flash Platform's scripting language, offers a lot of new and powerful features. ActionScript is now a full-fledged programming language, with complete ...
网络-coding-v3.0.zip网络-coding-v3.0.zip网络-coding-v3.0.zip网络-coding-v3.0.zip网络-coding-v3.0.zip网络-coding-v3.0.zip网络-coding-v3.0.zip网络-coding-v3.0.zip
AdvancED ActionScript 3.0: Design Patterns AdvancED ActionScript 3.0 is a fresh look and new approach to utilizing valuable, structural techniques and methods that are commonly used in the field of ...
亮白风格-图解网络-小林coding-v3.0.pdf
暗黑风格-图解网络-小林coding-v3.0.pdf
图解网络-小林coding-v3.0(亮白风格)
详尽的代码规范, 2008.10月版, 约40页PDF
AISG-Antenna-Port-Color-Coding天线端口颜色解析,不同端口颜色对应相应的天线频段,行业标准,要的拿走
documented and enforceable coding standard. The CERT Oracle Secure Coding Standard for Java provides rules for secure coding in the Java programming language. The goal of these rules is to eliminate ...
《C++ Coding Standards》Part 3
As this book teaches you how to build a real-world app, we primarily focus on showing you the coding side of things. We’re not going to ask you to paint your own icons, so we’ve provided them for ...
Contrastive Multiview Coding笔记
opencores_coding_guidelines.pdf. RTL_coding_hints.pdf simul-mismatch.pdf Talk about BiT length .pdf
EditPlus 3+zendCoding+自配的色彩风格+HTML、CSS语法文件,全部的功能都有了,配色也用了一个下午,语法文件也一并加进来了,其中HTML5的元素也在语法文件中了,CSS3的暂时还没有加入,有需要的朋友也可以自行加入...
c coding standard
matlab开发-用于外部压缩的HuffMancoding和Decoding。使用静态哈夫曼编码进行文本压缩和解压缩。
Phase coding