??xml version="1.0" encoding="utf-8" standalone="yes"?>无码国内精品久久人妻,国产午夜久久影院,久久天天躁狠狠躁夜夜不卡http://www.shnenglu.com/keigoliye/category/13129.html一切都是纸老虎zh-cnTue, 16 Mar 2010 13:33:59 GMTTue, 16 Mar 2010 13:33:59 GMT60AS3 event flow 事g冒机制http://www.shnenglu.com/keigoliye/archive/2010/03/15/109735.html暗夜教父暗夜教父Mon, 15 Mar 2010 07:03:00 GMThttp://www.shnenglu.com/keigoliye/archive/2010/03/15/109735.htmlhttp://www.shnenglu.com/keigoliye/comments/109735.htmlhttp://www.shnenglu.com/keigoliye/archive/2010/03/15/109735.html#Feedback0http://www.shnenglu.com/keigoliye/comments/commentRss/109735.htmlhttp://www.shnenglu.com/keigoliye/services/trackbacks/109735.html

大家好,今天亦乐首次为大家带来flash actionscript转蝲教程。首先声明出处(我自己是没时间写教程啦,要直接找我讨好)

 版权声明Q{载时请以链接Ş式标明文章原始出处和作者信息及本声?/em>
http://goday.blogbus.com/logs/14062836.html

 

今天Q我也正式宣布,开始成为闪客,以往对macromedia flash的许多头疼问题都被adobe解决了,以往一直否认我喜欢做flashQ现在ȝ可以为adobe flash 自豪。非常有pȝ的developing方式。RIA q_, on screen project׃q里说了?/p>

 

q期带来的是flash极重要元素之一Qevent事g。在游戏里就是所谓的Trigger. Adobe改良后的Q大家谓U的“冒机制”。有问题Ƣ迎发问指教?/p>

 

=思\大纲=

  1. ActionScript 2的问?/li>
  2. AS3解决问题
  3. l合问题Q说?#8220;冒”
  4. 冒的问题所在以及解x?/li>


1 - ActionScript 2的问?/u>

stage里有一个mcQmc里有一个btn
炚wmc实现拖动mcQ鼠标松开停止拖动
炚wmc实现mc隐藏?br style="line-height: 22px; ">最Ҏ惛_的方法,代码如下Q?/p>

mc.onPress = function() {
        this.startDrag();
};
mc.onRelease = function() {
        this.stopDrag();
};
mc.btn.onPress = function() {
        mc._visible=false
};

表面来看Q这个思\是正的。(实际上没什么思\可言Q很单的Ҏ。)
实际怎么P当然是不能实现?br style="line-height: 22px; ">问题Q点击btnQ不能触发btn的动作!Q!Q?br style="line-height: 22px; ">解释:  因ؓbtn处于mc内部Qmc被加上了事g以后Q按照as2的事件机Ӟmc内部的btn甚至是其他的元g都不能接受事件。或者可以认为mc的事件覆盖了mc中其他元件的事g?br style="line-height: 22px; ">从非冒机制来说Q在btn上点击鼠标,首先接受到点M件的自然是btn的上一层(也就是mcQ,然后才是btn元g。Mc先接受到点击事gQ触发相关的函数。然后呢Q我们要实现的点击btn的效果没了。我们可以认为mc把我们的鼠标点击事g据ؓU有了,不再往下传递。(如果是冒泡机制的话,q个动作回l箋往下传递到btnQ然后btn会执行。)那么q种效果在as2中还能实CQ答案自然是肯定的,不过Ҏ复杂了?br style="line-height: 22px; ">q里׃讨论了。As3已经成ؓL?br style="line-height: 22px; ">但是as3中的冒机制Q让我们可以单的解决q样的难题?br style="line-height: 22px; ">

2 - AS3解决问题

下面来看as3中怎么实现?br style="line-height: 22px; ">代码如下Q?/p>

import flash.events.*;
mc.addEventListener(MouseEvent.CLICK,mcfunction);
mc.btn.addEventListener(MouseEvent.CLICK,btnfucntion);

function mcfunction(event:MouseEvent) {
        trace("mc click");
}
function btnfucntion(event:MouseEvent) {
        trace("btn click");
}

 

看看代码p得,好像没用什么特别的解决ҎQ就加两个侦听函敎ͼ搞定了?br style="line-height: 22px; ">q个代码自然的不能再自然了,好像做flash 先的安装软g一栗?br style="line-height: 22px; ">但是如此自然的代码下面,使AS3的冒泡机制在提供支持?nbsp;

3 - l合问题Q说明冒泡机Ӟ
Help中有一个冒泡机制的图,怿大家都已l看q了
q里我联pd例,另外做一个图Q帮助各位理解?/p>

2D2D13C9009ACC1FF3AADD80E5C4FB85 

上图为as2中的执行原理
下图为as3中的执行原理
 2D8D966808DAEEA2C9701B5E09B334FE 
上图也就是在as3中实现我们文章开始提出的例子的工作原理?br style="line-height: 22px; ">下面详细描述一?/p>

捕获阶段Q?/u>
鼠标在btn上发出点MӞ首先捕捉到该事g的事stage.,然后事g往下传递到mcQ再到btn..Q如果鼠标事件发生在btn按钮中的一个label上,那么该事件还会l向下传递,直到扑ֈlabel元g。)AS2中,一旦找C可以相应事g的函敎ͼ停止了Q不会往下传递。这个道理应该说明白?br style="line-height: 22px; ">目标阶段Q?br style="line-height: 22px; ">扑ֈ我们的鼠标最底层的目标,也就是btn以后Q那么就开始执行btn的侦听函C?br style="line-height: 22px; ">    如果鼠标事g发生的所在位|,是mc中的btn中的一个label。那么将先执行label的侦听函数。(当然我们的例子中没有labelQ?br style="line-height: 22px; ">冒阶段Q?br style="line-height: 22px; ">执行了目标阶D늚侦听函数以后Q开始冒泡?br style="line-height: 22px; ">换一个说法是Q返回btn的父U元件mcQ如果能扑ֈ相关的侦听函敎ͼ那么执行,如果没有Q就l箋往上冒泡到btn的父U元件mc的父U元件stage。看能不能找到相关的侦听函数?/p>

注意一个:首先执行的函C定是目标对象的侦听函数。就像我们上面的例子一P点击btn会先trace(“btn click”),然后冒到mcQ执行trace(“mc click”)..然后l箋往上,如果stage我们也加一个侦听函敎ͼ执行语句Q那么还会l执?trace(“stage click”).
到达stage层了,冒l束?br style="line-height: 22px; ">说到q里Q各位看官也应该明白了as3的冒泡究竟是q什么用的了

4 - 冒的问题所在以及解x?/strong>
  冒也有问题Qƈ不是说它有缺P因ؓ出现问题无法避免?br style="line-height: 22px; ">  问题在于Q?br style="line-height: 22px; ">  假如在上面的例子中,我们不想在点击btn冒阶段中执行mc的侦听函敎ͼ我们只想执行btn的侦听函数。怎么解决Q?br style="line-height: 22px; ">同样的问题g伸出去,可以得到很多扩展和应用?br style="line-height: 22px; ">那么我们需要阻止他的冒泡的时候执行相关的侦听函数?br style="line-height: 22px; ">Chm中的Ҏ?/p>

stopImmediatePropagation():void
防止对事件流中当前节点中和所有后l节点中的事件侦听器q行处理?br style="line-height: 22px; ">stopPropagation():void
防止对事件流中当前节点的后箋节点中的所有事件侦听器q行处理?/blockquote>

用来修改我们上面的例?br style="line-height: 22px; ">代码如下Q?/p>

import flash.events.*;
mc.addEventListener(MouseEvent.CLICK,mcfunction);
mc.btn.addEventListener(MouseEvent.CLICK,btnfucntion);
function mcfunction(event:MouseEvent) {
        trace("mc click");
}
function btnfucntion(event:MouseEvent) {
        trace("btn click");
        event.stopPropagation();//修改在此处。简单一句,解决问题
}

现在可以试试Q点击btnq行得到的结果就?/p>

代码:
btn click

说明Q已l防止了冒阶段中对mc侦听函数的处理。也没有trace(“mc click”)?br style="line-height: 22px; ">As3事g机制q远不像q里写的那么单,q有很多东西需要研I?br style="line-height: 22px; ">本文只ؓ抛砖引玉Q让各位能先了解一下冒泡机制?br style="line-height: 22px; ">希望能多的朋友能提供相关的学习资?/p>

暗夜教父 2010-03-15 15:03 发表评论
]]>ActionScript 3中的cd?/title><link>http://www.shnenglu.com/keigoliye/archive/2010/03/08/109230.html</link><dc:creator>暗夜教父</dc:creator><author>暗夜教父</author><pubDate>Mon, 08 Mar 2010 14:00:00 GMT</pubDate><guid>http://www.shnenglu.com/keigoliye/archive/2010/03/08/109230.html</guid><wfw:comment>http://www.shnenglu.com/keigoliye/comments/109230.html</wfw:comment><comments>http://www.shnenglu.com/keigoliye/archive/2010/03/08/109230.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/keigoliye/comments/commentRss/109230.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/keigoliye/services/trackbacks/109230.html</trackback:ping><description><![CDATA[     摘要: 什么是反射反射 (Reflection) 是指在程序在q行?(run-time) 获取cM息的方式. 诸如实现动态创建类实例, Ҏ{? 在很语言中都有相关的的实? ?Java ?c# {反有什么用?as3 ?as2 不同, cd例中M元素, 如变?(variable), 讉K?(accessor, ?getter / setter), Ҏ (method) 都是不可?f...  <a href='http://www.shnenglu.com/keigoliye/archive/2010/03/08/109230.html'>阅读全文</a><img src ="http://www.shnenglu.com/keigoliye/aggbug/109230.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/keigoliye/" target="_blank">暗夜教父</a> 2010-03-08 22:00 <a href="http://www.shnenglu.com/keigoliye/archive/2010/03/08/109230.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>FAQsQ新手怎样学习Flash及as脚本~程Q?/title><link>http://www.shnenglu.com/keigoliye/archive/2010/02/24/108344.html</link><dc:creator>暗夜教父</dc:creator><author>暗夜教父</author><pubDate>Wed, 24 Feb 2010 06:27:00 GMT</pubDate><guid>http://www.shnenglu.com/keigoliye/archive/2010/02/24/108344.html</guid><wfw:comment>http://www.shnenglu.com/keigoliye/comments/108344.html</wfw:comment><comments>http://www.shnenglu.com/keigoliye/archive/2010/02/24/108344.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.shnenglu.com/keigoliye/comments/commentRss/108344.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/keigoliye/services/trackbacks/108344.html</trackback:ping><description><![CDATA[<span style="font-family: Arial; font-size: 14px; line-height: 20px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "><p style="line-height: normal; "><strong style="line-height: normal; "><font color="#800000" style="line-height: normal; ">一、写q个文章的v因:</font></strong></p><p style="line-height: normal; ">        l常遇到很多人想学习FlashQ但是不知道从何学vQ有的朋友甚臛_于学会了FlashQ能做些什么也很疑惑?/p><p style="line-height: normal; ">        本hl合若干qFlash学习研究l验Q给惛_习Flash的朋友一些徏议,也欢q大家访问我的空_<a style="color: rgb(153, 153, 153); text-decoration: none; word-wrap: break-word; word-break: break-all; line-height: normal; ">http://hi.baidu.com/billypc</a>l我留言。如转蝲本文Q希望多多宣传本I间Q谢谢?/p><p style="line-height: normal; ">       一般来_Flash的学习主要有两个方向Q一是专攻Flash动画Q一是专攻Flash~程Q当然也有动d~程都学习的很到位的人,那是牛h。不q这里我主要分析一下Flash的这两种方向如何开始学习,如何快速掌握?/p><p style="line-height: normal; "><strong style="line-height: normal; "><font color="#800000" style="line-height: normal; ">二、FAQs</font></strong></p><p style="line-height: normal; "><strong style="line-height: normal; "><font color="#003366" style="line-height: normal; ">问:学习flash做动画需不需要美术基啊?</font><br style="line-height: normal; "><font color="#333333" style="line-height: normal; ">{:<br style="line-height: normal; "></font></strong><font color="#333333" style="line-height: normal; ">        首先Q要说明的是QFlash动画也分为几U?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">        最重要的应用就是做动画片,比如早期的ShowGood三国Q小,现在的小破孩pdQ开心驿站系列,燕尾蝶等。这些都是动ȝ制作Q这一cȝflash需要有很好的美术功底,需要有诸如手绘Q视觉感Q镜头感{相关的专业知识。这一cȝ动画制作基本上需要美术和动画的专业知识。而Flash只是作ؓ一个动d作的工具而已Q一个动ȝ在从开始到l束Q更多的需要的是美术及动画斚w的专业知识?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">       另一cd用是Flashq告和FlashҎQ这一cFlash大量应用于网l,从网站主Flash动画Q到|站内部的一些广告,一些吸引眼球的效果Q都属于q一cd用。一般学习Flash的hQ基本上都在做这L东西。包括一些初学者在内,都认是FlashQ其实这只是Flash最单的应用。制作这一cȝFlash一般需要一些创意,有一定的视觉感,有美术基的h会更加得心应手。有时候会需要掌握一些基的flash asQ比如制作flash菜单Qflash跌{效果{?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">       Flash在动ȝ制作q程中,主要扮演的是工具的角Ԍ是目前动d作中效率比较高的工具之一Q而一个好的动画,q不依赖于你用什么工P而依赖于你的专业E度。专业知识越扎实Q创意越新颖Q做出的动画p好。而工L学习仅仅是第一步?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; "><strong style="line-height: normal; "><font color="#003366" style="line-height: normal; "><br style="line-height: normal; ">问:我也不知道应该学习哪个方向,动画和编E哪个好学啊Q?br style="line-height: normal; "></font>{:<br style="line-height: normal; "></strong>       学做动画Q和学做~程Q这样两个方向,其实不仅仅是做什么的不同Q也是思维方式的不同?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">       一般来_做动d视觉因素影响Q而编E主要受逻辑思维影响。从很宽泛的角度上来_学动画,是学感觉,学新思维。而学~程Q就是学逻辑Q学思维方式。美学不仅仅是能感觉刎ͼq是一U创意思维Q是感性的。而程序逻辑则完全是一U逆向思维Q是理性的?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">       一般情况下Q逻辑思维可以通过培训{,在短旉内锻炼出来,所以编E应该来说是Zh都能学会的,而且是可以通过死记背在短旉内速成的?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">       而感性思维Q或者说创造性思维Q是很难一下子养成的Q就像我们学ȝQ没有个一q半载,ҎMZ么好的东西,而且很多ȝ好的都是从小开始培ȝ。所以学动画短时间内很难有一些突_仅仅只能停留在一个较低的层面上,q也是Z么很多h只会做flashq告Q而做不了大于3分钟的动画,或者说做不出高质量的动ȝ原因了?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">        但是从入门的角度上来看,会用flash的hQ一般都能从事简单flash动画的制作,其实q主要是依靠了FLASHq款工具的强大,q代表着做动d单,或者你很聪明,一下子学会了Q入门也许很单,但是想提高一个层ơ就困难,比如学会FLASH没多久,׃做flash主页Qflashq告{,那是因ؓq个没有什么难度,所以综合看来,我认为,如果惛_短时间内Q从事flash工作的话Q可以先掌握flash的应用,能制作简单flash动画Q然后学习编E,短期内会很有效果。从长期来看Q学习一些美术基Q对做动M大有帮助?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; "><strong style="line-height: normal; "><font color="#003366" style="line-height: normal; "><br style="line-height: normal; ">问:我最q想dflash制作Q在|上找了找,发现有很多制作YӞ如flash MX,flash MX2004和flash cs3 ProQ哪ƾ比较好啊?<br style="line-height: normal; "></font>{:<br style="line-height: normal; "></strong>       2000q?flash 5.0 <br style="line-height: normal; ">       2002q?flash mx (是flash 6.0) <br style="line-height: normal; ">       2004q?flash mx2004 (是flash 7.0) <br style="line-height: normal; ">       2005q?flash 8.0 <br style="line-height: normal; ">       2006q?flash cs3 (是flash 9.0) <br style="line-height: normal; ">       2008q?flash cs4 (是flash 10.0)</font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">       目前的最新版本是flash cs4 功能非常强大Q不仅支持骨骼动画,q支?l等{,verycd上有视频教程Q可以去学习一下?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">      不过初学的话Q个人徏议你从flash cs3开始,以便今后玩flash cs4Q因Z们的操作性很怼QFlash 8现在虽然q是很多人在用,但是已经渐渐被新软g的新功能所取代?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">      FLASH CS3的好用之?Q?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">      1.cs3是ADOBE收购micromedia后的大作Q无Z动画设计上,q是E序语言上都有质的飞跃。比如钢W功能更加强大,强大的绘囑֊能,q些都让矢量囑ֈ作者提高了效率Q用更方便?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">      2.FLASH CS3引入了面向对象的AS3语言Q得AS不在是一个简单单的脚本语aQ而摇w变成一U强大的高E序语言。另外,FLASH CS3也全面支持AS之前的版本,从AS1到AS2均支持?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">     3.作ؓ初学者,因ؓ没有基础Q不存在用惯一个版本的软gQ用新版本时要重新熟悉的问题Q所以应量选择最新版本的软gq行学习Q因为时代是在进步的Q老版本的软gQ学完了也就淘汰了,再学新的Q还得重新熟悉界面及操作习惯?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">     4.目前׃flash cs4 10月䆾刚刚推出Q目前CS4的教材ƈ不多也不pȝQ所以徏议以FLASH CS3作ؓ学习的开始,而且FLASH CS4的界面和CS3差不多,只是加了些新功能?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; "><font color="#003366" style="line-height: normal; "><strong style="line-height: normal; "><br style="line-height: normal; ">问:怎样学会flash~程Q要有什么基Q要学c语言吗,哪里有教E啊Q该怎么学啊Q?</strong></font><br style="line-height: normal; "><strong style="line-height: normal; ">{:<br style="line-height: normal; "></strong>        如果你只是了解一下,|上的视频教E很多,可以ȝ一看?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">        但是如果你是很想学会Q那么我你,要学习一门知识,必ȝpȝ的教材。因此不推荐看视频教E,|上的视频教E虽然很多,但是都很隄l性的教会你代码的l构、编E的思想。所以我的徏议是C学习。最好不要看电子书,个h觉得Q看电子书的人,都喜Ƣ蟩着看,q样看就失去了意义。这L下来Q好像学会了Q其实什么原理都没搞懂?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">       要真正的C本书Q一一늚ȝ看,看一遍不够,一本书臛_3遍甚至n遍。还要多加练习。学习编E,首先从hello world开始,然后是要每天写Q经常写Q这h有进步?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">       很多Z有这L担心Q怕自己没有语a基础Q例如没有学习过C{。其实大可不必担心,语言只是一U工兯已Q目前的L语言好象同素异形体一P看似有区别,其实都差不多。这好像你会用WIN98,升CWIN XPQ你也不会说Q连怎么打开文g都要重头学习一栗学习编E的关键是学习编E的思想Q所以好的书教你怎么理解~程思想Q差的书只是叫你怎么写代码,其中区别很大?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">       AS2的书Q这里不做推荐了Q我也没看过什么好点的书,我学AS2完全是看帮助学会的Q主要是有JS基础?nbsp;<br style="line-height: normal; ">       q里推荐一本AS3的书Q《action script3.0D堂之\?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; "><strong style="line-height: normal; "><font color="#003366" style="line-height: normal; "><br style="line-height: normal; ">问:我是老程序员了,对Javascript和Java都比较擅长,现在惛_FlexQ但不知道有什么经怸点的书籍Q?br style="line-height: normal; "></font>{:<br style="line-height: normal; "></strong>        1.初学者,推荐《action script3.0D堂之\》,也有人推荐《as3权威宝典》个得那书写的不行?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">       2.flex的话Q推荐《flexW一步?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">       3.as3语言掌握?788了以后,可以ȝ以下一些书c?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">       4.实用书籍Q?nbsp;<br style="line-height: normal; ">         Action Script3.0 Cook Book —?cM帮助手册的书c?nbsp;<br style="line-height: normal; ">         Action Script3.0 设计模式 —?一本讲q程序设计思想的书c,强烈推荐</font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; "><font color="#003366" style="line-height: normal; "><strong style="line-height: normal; "><br style="line-height: normal; ">问:flash as2.0 ?as3.0的本质区别?</strong></font><br style="line-height: normal; "><strong style="line-height: normal; ">{:<br style="line-height: normal; "></strong>       首先说下as2,as2实际上是as1的升U版Q引入一面向对象的概念,但ƈ不是完全面向对象的语aQ只是在~译q程中支持OOP语法。as2的面向对象虽然不全面Q但是却是首ơ将OOP带到了FLASHQ而AS3是一个完全基于OOP的标准化面向对象语言Q最重要的就是as3不是as2的简单升U,而完全是两种思想的语a。可以说Qas3全面采用了面向对象的思想Q而as2则仍然停留在面向q程阶段QD个例子,像VB和C#的对比?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">       所以as3l不是as2的升U版Q在as3里,可以看到java和c#的媄子,实Q这三种语言大部分思想都是一致的Q只有一些小的区别,比如as3引入了命名空间的概念Q但是不支持比如委托,在包装及外部访问上也引入了一些新概念?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">       在编译阶D,as2采用的是AVM1QactionScript vitual machineQ,而as3采用的是AVM2。新一代虚拟机采用了OOP思想Q在执行速度上比起avm1也快?0倍。还提供了异常处理。以前我们在使用AS2Ӟ一旦出错,AVM1选择的是静默p|Q让人根本不知道什么地方出错了Q会费大量的时间去查错Q而AVM2与目前主的~译器一P会有异常处理Q运行出错会输出错误提示Q工作效率大大提高。如果做个对比,我想_AVM1是大刀长矛Q而AVM2是手枪Q大刀和长矛也能杀敌,但是只在面对弱智的敌人才能发挥作用,面对一个大型项目,不用点现代化工具是不行滴?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">        as2与as3的部分区别,只说一些大的区别,的不同太多Q就不谈了:</font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">        1.q行时异常机制处理,q个刚才说过了?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">        2.事g机制Q这也是很多人拿起as3׃知所措的原因Q初学者会发现q一个按钮点ȝҎ都写不出来。实际上as3的事件机刉用的是监听的方式Q和as2时代的onClipEvent不同Qas3里所有的事g都是需要触发器Q监听器Q执行器三种l构的,q样做的好处是使得q个语言非常的坚强,非常的标准化。不像as2,奇Ş怪状的代码O天飞Q可以这样写Q也可以那样写,代码变得J复难懂Q可L太差,执行效率也大大降低。要特别说明的是Qas3的所有事仉直接l承event对象Q而event是直接承自大老板Objectc?l构多么完美。所以在as3中,所有的事g都承自相同的父Ԍl构相同Q提高了重用性?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">        3.装性,q是as3与as2最大的不同Qas3引入了封装的概念Q得程序安全性大大提高,各个对象之间的关pM通过装Q访问控制而得以确定,避免了不可靠的访问给E序带来的意外生?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">       4.XMLQ我觉得q是最令hȀ动h心的改变Q现在as3E序员可以很L也很自豪的说Q我们是使用XML人群中最快乐的h。AS2时代对XML的存取仍焉要解析,而AS3则创新的XML也视作一个对象,存取XML像存取普通对象的属性一h便,用点语法可以,无疑大大提高了效率?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">      5.最关键的一点,容器的概念,AS3采用了容器的思想Q告别了as2一个MovieClip打天下的局面。对于as2E序员来_可能不能理解Q我mc用的好好的,q嘛不让我用啊。但是当你真正的了解as3的思想的时候,当你真主的体会到OOP的好处的时候,你会觉得as3的容器的思想的完全正的。as2时代Q我们做什么都用mc,而as2时代的mc也是直接l承自objectQ这l了mc极大的权限,极其多的Ҏ属性,而有时我们只需要放一个背景图Qƈ不需要它动,q样做就造成了极大的费。说实在话as2和as3比v来就是浪费之,所以as2~出的swfl对比as3~译出来的swf要大上几倍。as3把所有你用到的显C对象都分开Qmc的属性方法都被瓜分开来,举个例子Q你L果超市买水果Q就肯定比直接去大型市买要方便Q更节约旉Q时间就是金钱,那就是很大的节省?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">      当然q有许许多多的不同,比如E序执行机制Q设计模式,l构框架{等Q这里就不在一一赘述?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; "><font color="#003366" style="line-height: normal; "><strong style="line-height: normal; "><br style="line-height: normal; ">问:怎么才能成ؓ~程高手Q?/strong></font><br style="line-height: normal; "><strong style="line-height: normal; ">{:<br style="line-height: normal; "></strong>        可以_学会~程q不难,怎么才能写出好的E序Q这是很多h所困惑的事情,我有时候也是左思右惻I觉得自己写出来的东西太在是太垃圾了。那么真正的高手他们在做些什么呢Q他们到底因Z么才能成为高手呢Q?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">       其实Q我们很多h都仅仅停留在会写E序的阶D,q没有去研究Q一个程序怎么写才是合理的,什么样的结构,才是最完善的,什么样的布局才是可扩展的。什么样的代码才是最高效的。而这正是高手花功夫去研究的事情,也是Z么高手能做的更好的原因?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">      我ȝ了一下,觉得以下才是一个程序员应该思考的路:</font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">     1.W一cMhQ会写程序,q没什么,Zh都能办到?70%的程序员都在q里)</font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">      2.W二cMhQ有一定的l构思想Q能做设计结构上的调整。能走到q一步,应该可以真正入门了?15%的程序员在这里,很不q,本h也在q里?</font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">     3.W三cMhQ熟l应用各U设计模式,Cq里Q才涉高U编E领域。这L人才能算高手。(10%左右Q我想黑同志应该属于这个别)</font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">     4.W四cMhQ有法分析和创意思维Q能做到q一步的人,写出来的E序׃叫程序了Q叫伟大发明Q(5%左右Q微软和h的专家们在这里)</font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">     5.W五cMhQ这一cMh是我不敢惌的,已经出我的思考范畴了。(向0%Q?/font></p><p style="line-height: normal; "><font color="#333333" style="line-height: normal; ">最后,Ƣ迎大家癑ֺHI我,和我探讨相关的技术?br style="line-height: normal; "></font><font color="#333333" style="line-height: normal; ">或者加入百度HI:flash知道Q?)1051316?flash知道Q?)1084144</font></p></span> <img src ="http://www.shnenglu.com/keigoliye/aggbug/108344.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/keigoliye/" target="_blank">暗夜教父</a> 2010-02-24 14:27 <a href="http://www.shnenglu.com/keigoliye/archive/2010/02/24/108344.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>лǵվܻԴȤ</p> <a href="http://www.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.buniss.cn" target="_blank">һaƬþëƬ</a>| <a href="http://www.logeng.cn" target="_blank">ɫۺϾþþþĻ</a>| <a href="http://www.bihuresorthotel.cn" target="_blank">þƵ</a>| <a href="http://www.elecline.com.cn" target="_blank">þĻƷһ</a>| <a href="http://www.aigoou.cn" target="_blank">þĻר</a>| <a href="http://www.t24196.cn" target="_blank">þþƷ2020</a>| <a href="http://www.zhidaow.com.cn" target="_blank">þ޾ƷĻ</a>| <a href="http://www.2046film.cn" target="_blank">ĻۺϾþ2</a>| <a href="http://www.vjqm.cn" target="_blank">ɫ8ŷ˾þۺϵ</a>| <a href="http://www.fvxg.cn" target="_blank">þۺϾɫۺվ</a>| <a href="http://www.41422.com.cn" target="_blank">ձһƷþþþӰԺ</a>| <a href="http://www.pbxdt.com.cn" target="_blank">޾Ʒһۺ99þ </a>| <a href="http://www.hwumbrella.cn" target="_blank">޾Ʒþþþþ</a>| <a href="http://www.4fp5r8p.cn" target="_blank">޾þˬ˾Ʒ</a>| <a href="http://www.viparadise.com.cn" target="_blank">ŷһþۺ</a>| <a href="http://www.or-z.cn" target="_blank">wwþþþþþþþ</a>| <a href="http://www.idccyy.cn" target="_blank">ձŷþþþѲ</a>| <a href="http://www.818wg.cn" target="_blank">þ¶Ʒ</a>| <a href="http://www.whcxjj.cn" target="_blank">þõӰ</a>| <a href="http://www.fvxg.cn" target="_blank">þùȾƷҰAV</a>| <a href="http://www.deshizhai.cn" target="_blank">þþžžþƷ</a>| <a href="http://www.rrthhz.cn" target="_blank">þ99Ʒ鶹լլ</a>| <a href="http://www.dgchengxin.cn" target="_blank">þۺϾþڹ</a>| <a href="http://www.nt52.cn" target="_blank">ɫþþ99Ʒ91</a>| <a href="http://www.rnif.cn" target="_blank">þþþŮAAƬ</a>| <a href="http://www.nic-xie.cn" target="_blank">˾þóۺӰԺ </a>| <a href="http://www.yinyue580.cn" target="_blank">ƷþþþӰ</a>| <a href="http://www.mayingbao.cn" target="_blank">ŷ޾þþþƷ</a>| <a href="http://www.dingbay.cn" target="_blank">999þþùƷ</a>| <a href="http://www.47g.com.cn" target="_blank">99ƷþþƷһ</a>| <a href="http://www.jisuxb.cn" target="_blank">ƷŮ߳׾þþ</a>| <a href="http://www.donki.net.cn" target="_blank">þþþó˾Ʒ</a>| <a href="http://www.9lang.cn" target="_blank">˾Ʒþ޸岻 </a>| <a href="http://www.lanqie.com.cn" target="_blank">޹Ʒþþ </a>| <a href="http://www.zhengulao.cn" target="_blank">þҹ³˿ƬҹƷ</a>| <a href="http://www.0795fcw.cn" target="_blank">ŷպƷþ</a>| <a href="http://www.trjyzj.cn" target="_blank">þþƷ</a>| <a href="http://www.fjprxr.cn" target="_blank">ƷþþþþóAV</a>| <a href="http://www.fimtb.cn" target="_blank">þþþ99ƷƬŷ</a>| <a href="http://www.vmtkcxf.cn" target="_blank">޾Ʒһþ </a>| <a href="http://www.dui46.cn" target="_blank">ɫúݺݾþۺ</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>