Actionscript 3 - First steps

      FLASH 2005-10-19 23:7
As you might know, Macromedia published the Flex2 alpha to the public. This gives us mere mortals the opportunity to explore the features of Actionscript 3, Flexbuilder2 and Flex, which is a great move of Macromedia.

As an Actionscripter my main interest is Actionscript 3. And in fact Flexbuilder 2 allows for creating pure Actionscript content without the need of the Flex framework. While i'm exploring Actionscript 3 during the next few days, i'm going to publish my findings right here. If you like, feel yourself invited to follow me on my journey.

Start here
Create a new Actionscript project with a main class named Test. This class will accompany us during the the next few days. It is our main container to be excuted and looks something like this:
//这一系列文章主要不是介绍用Flexbuilder2来开发FLEX2应用,用Flexbuilder2主要是开发AS3的。在Actionscript project中新建一个Actionscript project。代码如下
package {
        import flash.util.trace;
        import flash.display.MovieClip;
        
        public class Test extends MovieClip {
                public function Test() {
                        trace("hi, i'm " + this);
                }
        }
}


//需要注意的是在AS3中,你要使用trace就必须先import flash.util.trace
//选择DEBUG,调试信息显示在右下[Console]窗体中
The first tidbit to know is, that the good old trace function now sits inside of flash.util and has to be explicitely imported.

To make the trace visible we have to use "debug as" in contrast to "run as". You can call it by rightclicking the class' sourcecode and choosing "debug as" from the context menu.

Cheers,
Ralf.
/////////////////
因为是个人读书的笔记,所以没有进行翻译,只是对其中关键地方进行注释。如有错误欢迎指出。
原文转载自: www.helpqlodhelp.com/blog/

标签集:TAGS:
回复Comments() 点击Count()

回复Comments

{commenttime}{commentauthor}

{CommentUrl}
{commentcontent}