毕业论文 论文提纲 论文写作 公文范例 教育论文 教育学论文 师范教育 学术论文     论文指导*
                     
 
   
   
   
   
           
 

当前位置:课件115学培吧(kj115.com)→flash网侠教程(助你成为顶尖课件高手)→系列文章

 
 
标题:初学AS3的几点技巧汇总
 
展示台

文章来源 作者:admin 密码:admin 整理:湖北金鹰

◇网侠教程栏目简介
    提供FLASH侠客教程和网页制作侠客教程,高手进阶教程。
    浏览过这些资源的还浏览过经典教程图文教程游戏开发教程等相关资源。

---------------

湖北金鹰课件吧

论文相关服务
 

 

1.null和undefined的差別在於
null是指沒有值
undefined是宣告未完全、沒有宣告這個屬性或沒有指定資料型態(未賦予值沒做過資料轉型也算)
null==undefined但null!==undefined
所以我們常常要檢查外部變數有沒有被賦予值要用
if(外部變數==null){
外部變數沒有被賦予值
}
2.把變數宣告在所有程式(FUNCTION)的最上面
3.執行container.addChild(ball_A);時,若container已存在ball_A這個物件,在執行1次的功能在於,PLAYER會把原有的ball_A刪掉,再重新加入ball_A,所以ball_A顯示的順序就會變成在最上面,若你要指定顯示順序就用container.addChildAt(ball_A, 1);這個指令(0-N),0為最底層N為目前最上面ㄧ層
4.自動管理顯示順序
trace(container.getChildAt(0).name); // ball_A
trace(container.getChildAt(1).name); // ball_C
trace(container.getChildAt(2).name); // ball_B
container.removeChild(ball_C);
trace(container.getChildAt(0).name); // ball_A
trace(container.getChildAt(1).name); // ball_B
5.delete 才會完整的把物件殺掉removeChild只是移除顯示清單而已,ㄧ個物件只能對應一個container
6.其他好用的函式
contains(): Determines whether a display object is a child of a DisplayObjectContainer.
getChildByName(): Retrieves a display object by name.
getChildIndex(): Returns the index position of a display object.
setChildIndex(): Changes the position of a child display object.
swapChildren(): Swaps the front-to-back order of two display objects.
swapChildrenAt(): Swaps the front-to-back order of two display objects, specified by their index values.
7.取代AS 2.0 用[]動態命名的方法
import Flash.display.Sprite;
var container1:Sprite = new Sprite();
container1.name="allen";
container1.x=20;
var container2:Sprite = new Sprite();
container2.addChild(container1);
addChild(container2);
trace(container2.getChildByName("allen").x);
沒錯就是這一行container1.name="allen";直接指定name

 

 
课件115学培吧(湖北金鹰)欢迎您!永久免费服务网址:http://www.kj115.com
   
 

学员众多的FLASH课件学习基地,成万免费FLASH课件制作教程在线学习,还有免费内容课件教程、视频教程、课件技巧、课件探讨、课件欣赏、课件展示、实用教程、课件界面、课件脚本、课件游戏、课件下载、课件封面、课文内容图片、课文人物图片库、课件素材、图片素材、声音素材、动物素材、背景图片、背景资料、背景边框、课件顶栏图片素材、Dreamweaver教程、Dreamweaver网页课件教程、软件下载。承接学习和培训,承接课件订制,课件修改等所有课件相关服务。
本站主要业务:┃flash课件制作视频教程培训┃承接全国竞赛flash课件┃论文代写代发┃代办课件国家级获奖证书┃
联系:QQ:444860709 手机:13339817386


 
 

业务办理
鄂ICP备08005724号