开发者

ActionScript 2 - ActionScript 3: common subset?

开发者 https://www.devze.com 2023-01-05 23:04 出处:网络
I\'d like to automatically generate ActionScript classes for a flash开发者_高级运维 client side of one of my projects. (These projects have a formal way of describing my models that is already used to

I'd like to automatically generate ActionScript classes for a flash开发者_高级运维 client side of one of my projects. (These projects have a formal way of describing my models that is already used to generate SQL and a admin interface).

Now, the ActionScript should/could be compatible with ActionScript 2 and 3. Is there a description of a maximal common subset of features available somewhere?


I think you will be stumped right of the bat, because AS2 and AS3 declare there classes/packages differently.

If you are looking to create Classes from templates, then I would suggest using FlashDevelop. It has a get templating system.

ActionScript 2 Class/Package example:

class com.yourpackage.YourClass extends MovieClip {
  function YourClass() {
    //contructor
  }
}

ActionScript 3 Class/Package example:

package com.yourpackage {
  public class YourClass extends MovieClip {
    public function YourClass():void {
      //contructor
    }
  }
}

But this is all just syntax. There are a lot more fundamental deferences between the languages than just formatting. There is also a different way of thinking.


One possible alternative to enable you to do this, would be to use Haxe.

0

精彩评论

暂无评论...
验证码 换一张
取 消