Forum Topic: Difference Between As2 And As3?

(231 views • 14 replies)

This topic is 1 page long.

<< < > >>
Sad

Oddler

Reply To Post Reply & Quote

Posted at: 4/20/08 02:06 AM

Oddler LIGHT LEVEL 15

Sign-Up: 05/27/07

Posts: 275

I was watching a Tutorial on button making and when I was doing what the directions were saying step by step as I watched the tut to get practice...when it got to one step where it told me to open up the Behavior panel and click the "+" sign to add some action script goodness to your button...my Flash CS3 flipped out and said I can't do that action with AS3 and that I'd have to do it with either AS1 and AS2 but not AS3...

When you open a Flash document on Flash CS3 and it asks about which you would like... ActionScript3.0 or ActionScript 2.0 what exactly is the purpose of this?


None

GustTheASGuy

Reply To Post Reply & Quote

Posted at: 4/20/08 03:10 AM

GustTheASGuy LIGHT LEVEL 08

Sign-Up: 11/02/05

Posts: 9,605

The tutorial is for AS2. Select version 2 in the publish settings.

haXe AliceML Box2dLite Learn AS
#ngprogramming at irc.freenode.net
OVER NINE THOUSAAAAND!!!


None

iyeru42

Reply To Post Reply & Quote

Posted at: 4/21/08 11:47 AM

iyeru42 NEUTRAL LEVEL 15

Sign-Up: 03/21/06

Posts: 161

Migration from AS2 to AS3.

Read it, and you may dislike it. I know I don't like what they did in some respects (like removing the _root property.)

BBS Signature

None

GuyWithHisComp

Reply To Post Reply & Quote

Posted at: 4/21/08 11:53 AM

GuyWithHisComp LIGHT LEVEL 23

Sign-Up: 11/10/05

Posts: 4,029

At 4/21/08 11:47 AM, iyeru42 wrote: (like removing the _root property.)

Good thing they didn't, then!
It's just called root now instead and is a member of DisplayObject, not MovieClip.
To use it as a MovieClip (and access root variables) just use MovieClip(root).varName

BBS Signature

None

Pixelwelder

Reply To Post Reply & Quote

Posted at: 4/21/08 02:21 PM

Pixelwelder NEUTRAL LEVEL 01

Sign-Up: 03/14/08

Posts: 126

At 4/21/08 11:47 AM, iyeru42 wrote: Migration from AS2 to AS3.

Read it, and you may dislike it. I know I don't like what they did in some respects (like removing the _root property.)

Using _root/root in the first place is a bad idea.

Flash Game Development Blog: { P I X E L W E L D E R S } | Coming soon: OS Wars: Winvasion!

BBS Signature

None

Skeik-Sprite

Reply To Post Reply & Quote

Posted at: 4/21/08 03:10 PM

Skeik-Sprite LIGHT LEVEL 13

Sign-Up: 06/19/05

Posts: 1,358

At 4/21/08 02:21 PM, Pixelwelder wrote:
At 4/21/08 11:47 AM, iyeru42 wrote: Migration from AS2 to AS3.

Read it, and you may dislike it. I know I don't like what they did in some respects (like removing the _root property.)
Using _root/root in the first place is a bad idea.

How so?


None

dELtaluca

Reply To Post Reply & Quote

Posted at: 4/21/08 03:14 PM

dELtaluca LIGHT LEVEL 20

Sign-Up: 04/16/04

Posts: 5,093

At 4/21/08 03:10 PM, Skeik-Sprite wrote: How so?

Because it's wildly unnecesary and messy.

My social worker says im special!

BBS Signature

None

Paranoia

Reply To Post Reply & Quote

Posted at: 4/21/08 03:42 PM

Paranoia DARK LEVEL 31

Sign-Up: 04/22/05

Posts: 9,115

At 4/21/08 03:14 PM, dELtaluca wrote:
At 4/21/08 03:10 PM, Skeik-Sprite wrote: How so?
Because it's wildly unnecesary and messy.

I don't know - when you're using Flash like you're supposed to - you know, taking advantage of its animation capabilities - accessing clips and objects at the top timeline is pretty useful.

A rate of change in sanity with respect to time.

BBS Signature

None

iyeru42

Reply To Post Reply & Quote

Posted at: 4/21/08 08:09 PM

iyeru42 NEUTRAL LEVEL 15

Sign-Up: 03/21/06

Posts: 161

At 4/21/08 03:42 PM, Paranoia wrote:
At 4/21/08 03:14 PM, dELtaluca wrote:
At 4/21/08 03:10 PM, Skeik-Sprite wrote: How so?
Because it's wildly unnecesary and messy.
I don't know - when you're using Flash like you're supposed to - you know, taking advantage of its animation capabilities - accessing clips and objects at the top timeline is pretty useful.

Indeed, but this snippet:

flash.display.DisplayObject.stage

is really stretching it; very long, and probably not even the same response.

BBS Signature

None

sspecter

Reply To Post Reply & Quote

Posted at: 4/21/08 09:01 PM

sspecter DARK LEVEL 11

Sign-Up: 09/28/05

Posts: 387

What are you guys are talking about? If you turn off the strict mode in AS3 the "root" property will work almost exactly like _root!

And for scrict mode just use

MovieClip(root)

or

(root as MovieClip)

I really don't understand why you people whine about things you CAN do on AS3.


None

sspecter

Reply To Post Reply & Quote

Posted at: 4/21/08 09:15 PM

sspecter DARK LEVEL 11

Sign-Up: 09/28/05

Posts: 387

At 4/21/08 03:10 PM, Skeik-Sprite wrote:
At 4/21/08 02:21 PM, Pixelwelder wrote:
At 4/21/08 11:47 AM, iyeru42 wrote:
Using _root/root in the first place is a bad idea.
How so?

_root/root and parent/_parent, although useful in the animation point of view, is a very bad design idea in Object Orientation. A child instance from another instance should not be able to control it's parent. The parent is the one who should control his children.

To OO point of view, If you, for any reason, need to use "root" or "parent" then there is something very wrong: the Movie/property you are trying to access should be inside where you are using it, not outside.

Nonetheless, AS3 DO allow you to access parent and root, and all their properties. You just have to use type cast for it (explicitly stating the type of parent and root, like I've showed in my previous post)


None

iyeru42

Reply To Post Reply & Quote

Posted at: 4/22/08 08:39 AM

iyeru42 NEUTRAL LEVEL 15

Sign-Up: 03/21/06

Posts: 161

At 4/21/08 09:15 PM, sspecter wrote: To OO point of view, If you, for any reason, need to use "root" or "parent" then there is something very wrong: the Movie/property you are trying to access should be inside where you are using it, not outside.

*cough*

$this->$settingsFunc() = "Dude";

PHP is riddled with stuff like that, and do you complain about $this as well?

BBS Signature

None

GustTheASGuy

Reply To Post Reply & Quote

Posted at: 4/22/08 09:47 AM

GustTheASGuy LIGHT LEVEL 08

Sign-Up: 11/02/05

Posts: 9,605

At 4/21/08 08:09 PM, iyeru42 wrote: flash.display.DisplayObject.stage

The first two are the classpath and the third is the class. Since most of the code you write in Flash is on subclasses of DisplayObject you'll only need 'stage' to refer to the property.

A language that would be both directly functional and object-oriented would be good.

haXe AliceML Box2dLite Learn AS
#ngprogramming at irc.freenode.net
OVER NINE THOUSAAAAND!!!


None

Rustygames

Reply To Post Reply & Quote

Posted at: 4/22/08 10:58 AM

Rustygames LIGHT LEVEL 18

Sign-Up: 05/07/05

Posts: 6,427

They are different languages. If you want to learn one, learn AS3, it's easier. If you don't and you have a developer, ask him which one to use. If you have no developer and just want a button in your movie or whatnot, just use AS2

- Matt, Rustyarcade.com


None

iyeru42

Reply To Post Reply & Quote

Posted at: 5/6/08 04:59 PM

iyeru42 NEUTRAL LEVEL 15

Sign-Up: 03/21/06

Posts: 161

At 4/22/08 10:58 AM, Rustygames wrote: They are different languages. If you want to learn one, learn AS3, it's easier. If you don't and you have a developer, ask him which one to use. If you have no developer and just want a button in your movie or whatnot, just use AS2

They technically aren't; same language different version. PHP 4 and PHP 5 have very little differences in coding structure mind you.

BBS Signature

All times are Eastern Daylight Time (GMT -4) | Current Time: 07:37 PM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!