FLASH CS3/CS4 使用外部AS文件的Hello World

1,建立一个FLA

2,建立一个AS

3,内容如下

package {
  
  import flash.display.*;

  public class Main extends MovieClip  {

    // Constants:
    // Public Properties:
    // Private Properties:

    // Initialization:
    public function Main() {

      trace("hola");

    }

    // Public Methods:
    // Protected Methods:
  }

}


4,在FLA的属性里面的Document Class里面写上 Main

5,就这样,你就可以不在时间线上写AS了。

6 comments

  1. spe 说道:

    一切皆是对象,不是都应该这么 写吗?我觉得不应该称外部文件,这个并不是单纯的吧AS写在外部,这个as文件代表就是这整个FLASH。还有如果你是一个帧的没必继承于MovieClip。

  2. 1 说道:

    [EMAIL][/EMAIL][EMAIL=@][/EMAIL][URL][/URL][URL=http://][/URL][B][/B][I][/I][U][/U][S][/S][QUOTE][/QUOTE]CoolAngryAfter_boomMisdoubtLoveCryCryFaintShame

  3. yy 说道:

    还以为是CS4有改变呢
    你应该把文档类当作入口类

  4. das 说道:

    路过。顺便看看

  5. Fletcher Krase 说道:

    I just want to mention I am just very new to blogging and absolutely loved this page. More than likely I’m likely to bookmark your website . You definitely have excellent posts. Bless you for revealing your webpage.

  6. Dirk Morgan 说道:

    Another thing I have noticed is the fact for many people, poor credit is the reaction of circumstances above their control. Such as they may be really saddled through an illness and because of this they have substantial bills going to collections. It would be due to a employment loss or maybe the inability to do the job. Sometimes breakup can truly send the funds in an opposite direction. Thank you for sharing your ideas on this blog.

发表评论

电子邮件地址不会被公开。