0

I want to make my application compatible with as2, so I think what I want to do is only use the features that as2 provides, how to specify the compiler or source code that I only use the features in as2?

o0'.
  • 11,739
  • 19
  • 60
  • 87
Bin Chen
  • 61,507
  • 53
  • 142
  • 183

5 Answers5

8

AS3 and AS2 are not compatible. You have to choose whether you use AS3 or AS2 in your project. However, currently, there is almost no point in writing new projects in AS2, because Flash Player 9 reaches 99% penetration rates, according to Adobe

So, start a new project in AS2 only if you desperately need it for some reason. In all other cases AS3 is your weapon of choice.

Hrundik
  • 1,818
  • 13
  • 13
  • Yes, I have the reason to use AS2, you didn't answer my question how to use it instead AS3 :) – Bin Chen Jan 08 '10 at 02:09
  • In that case you need to develop your project in AS2. You can do it either in Flash Professional IDE (not in Flex/Flash Builder), or using open-source AS2 compiler mtasc and develop in your editor of choice, like FlashDevelop. – Hrundik Jan 08 '10 at 10:57
1

flex means only AS3 and higher. AS2 was earlier use inf flash for code behind. now even flash supports AS3 and as said earlier answers Adobe Virtual Machine for AS3 which is adobe flash 9 plugin/activex is widely deployed and you may no more need AS2

scienty
  • 314
  • 1
  • 3
0

I'd like to point out that sometimes there's no option to NOT support it. Although as3 is at 99% penetration, that number doesn't reflect embedded devices. And it is frequently the ONLY option.

seth
  • 1
0

The default compiler settings for Adobe Flex Builder are -as3 = true and -es = false.

The ECMAScript-3 compiler is an advanced option which bridges the gap significantly:

Instructs the compiler to use the ECMAScript edition 3 prototype-based object model to allow dynamic overriding of prototype properties. In the prototype-based object model, built-in functions are implemented as dynamic properties of prototype objects.

To use the prototype object model, set the compiler accordingly, either:

  • In the ActionScript file via the ES namespace:

    use namespace ES;
    
  • In the compiler path via the flags:

    -as3 = false -es = true
    

The dynamic keyword and a namespace wrapper should be able to do the rest of the legwork, not accounting for API differences.

References

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265
0

AS3 is about 10 times more faster than AS2. AS2 will soon not be supported by many portals. AS2 libraries a decreasing in number, and resources are also discontinued. I'd go with AS3.

qwerber
  • 139
  • 1
  • 3