如何使用ActionScript 3使用两个.as文件在Flash? [英] How to use two .as files in Flash using actionscript 3?

查看:134
本文介绍了如何使用ActionScript 3使用两个.as文件在Flash?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只能指定一个。如文件,我怎么能在这2个班?

I can only specify a single .as file,how can I have 2 classes in it?

推荐答案

该文件(在你的情况,它的MinPlay)指定称为文档类。

The file (In your case, its MinPlay) you specify is called the document class.

在这些文件中的内容,该文件应该有一个类名为MinPlay延伸无论是Sprite或MovieClip类。类似于

Among the contents in the file, the file is supposed to have class a class named 'MinPlay' which extends either a Sprite or Movieclip. Something like

package 
{   
  public class MinPlay extends Sprite
     {
     // Constructor??
     }
}       

因此​​,基本上,当你在文档类的上述类型的构造函数将被调用。这是完全由你来初始化新类,添加事件侦听器或做任何你喜欢从这里开始。您可以创建任意数量的类文件(如文件)及它们连接在一起,它的直前言OOP从这里开始。

So basically when you type in the document class as above, the constructor will be called. It is totally up to you to initialize new classes, add event listeners or do whatever you like from here on. You may create any number of class files (as files) & link them all together, it's straight foreward OOP from here on.

关于你的问题。好了这件事,认为每一个编程语言都需要有一个单一的入口点,这在闪光灯的情况下是文档类。闪光的目的是做什么,你就已经与动作做的,或者说写code为您服务。因此,文档类是一样的东西说:让我继续在这里。

About your question. Well about that, consider that every programming language needs to have a single entry point, which in the case of flash is the document class. Flash is designed to do what you would already do with actionscript, or rather write code for you. So document class is something like saying "let me carry on from here".

这篇关于如何使用ActionScript 3使用两个.as文件在Flash?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆