Re: [Flashcoders] clean scripting

2008-03-12 Thread Muzak
ay, March 12, 2008 9:02 PM Subject: Re: [Flashcoders] clean scripting Here's my understanding of the reason behind this: AS2 is basically just syntactic sugar over AS1, and gets compiled down to the same thing. When defining a class you're actually defining things on the prototype, so doin

Re: [Flashcoders] clean scripting

2008-03-12 Thread Andy Herrman
Here's my understanding of the reason behind this: AS2 is basically just syntactic sugar over AS1, and gets compiled down to the same thing. When defining a class you're actually defining things on the prototype, so doing this: -- class MyClass { public var myArray:Array; public

Re: [Flashcoders] clean scripting

2008-03-12 Thread Dave Mennenoh
So yea...WTF? I can't believe after my years of AS2 coding that it would have taken me this long to notice. I think I muttered those exact words. Bizzare behavior. Though I don't think I have ever run into it. Someone taught me long ago not to initialize class variables in their definitions. S

RE: [Flashcoders] clean scripting

2008-03-12 Thread Jesse Graupmann
04 AM To: Flash Coders List Subject: Re: [Flashcoders] clean scripting In AS2 it does (and has been discussed here in the past), in AS3 it doesn't. - Original Message - From: "Jesse Graupmann" <[EMAIL PROTECTED]> To: "'Flash Coders List'" Sent:

Re: [Flashcoders] clean scripting

2008-03-12 Thread Muzak
In AS2 it does (and has been discussed here in the past), in AS3 it doesn't. - Original Message - From: "Jesse Graupmann" <[EMAIL PROTECTED]> To: "'Flash Coders List'" Sent: Wednesday, March 12, 2008 5:38 AM Subject: RE: [Flashcoders]

Re: [Flashcoders] clean scripting

2008-03-11 Thread Paul Andrews
- Original Message - From: "Allandt Bik-Elliott (Receptacle)" <[EMAIL PROTECTED]> To: "flashcoders" Sent: Tuesday, March 11, 2008 5:41 PM Subject: [Flashcoders] clean scripting hi just a semantic question really when writing your classes, would you onl

RE: [Flashcoders] clean scripting

2008-03-11 Thread Jesse Graupmann
PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steven Sacks Sent: Tuesday, March 11, 2008 6:49 PM To: Flash Coders List Subject: Re: [Flashcoders] clean scripting I'm going to chime in here. Lazy Instantiation is an irrelevant argument when you're instantiating in the constructor.

Re: [Flashcoders] clean scripting

2008-03-11 Thread Fumio Nonaka
Behalf Of Muzak Sent: Tuesday, March 11, 2008 4:51 PM To: Flash Coders List Subject: Re: [Flashcoders] clean scripting Allthough the following no longer seems to apply in AS3, it might be good to know. In AS2, if you have the following class: class MyClass { private var myArray:Array =

RE: [Flashcoders] clean scripting

2008-03-11 Thread Jesse Graupmann
); } public function get data():Array { return MyClass.myArray; } } regards, Jesse -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Muzak Sent: Tuesday, March 11, 2008 4:51 PM To: Flash Coders List Subject: Re: [Flashcoders] clean scripting

Re: [Flashcoders] clean scripting

2008-03-11 Thread Steven Sacks
I'm going to chime in here. Lazy Instantiation is an irrelevant argument when you're instantiating in the constructor. What you perceive as "cleaner" is merely philosophical. var container:Sprite = new Sprite(); vs var container:Sprite; public function ClassName() { container = new Spri

Re: [Flashcoders] clean scripting

2008-03-11 Thread Allandt Bik-Elliott (Receptacle)
also keep memory use limited. HTH C -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Allandt Bik-Elliott (Receptacle) Verzonden: dinsdag 11 maart 2008 18:41 Aan: flashcoders Onderwerp: [Flashcoders] clean scripting hi just a semantic question reall

Re: [Flashcoders] clean scripting

2008-03-11 Thread Muzak
Allthough the following no longer seems to apply in AS3, it might be good to know. In AS2, if you have the following class: class MyClass { private var myArray:Array = new Array(); public function addItem(item:Object) { myArray.push(item); } public function get data():Array { return myArra

Re: [Flashcoders] clean scripting

2008-03-11 Thread Cory Petosky
008 18:41 > Aan: flashcoders > Onderwerp: [Flashcoders] clean scripting > > > hi > > just a semantic question really > > when writing your classes, would you only declare variables in the class and > assign variables later or would you assign values straight a

RE: [Flashcoders] clean scripting

2008-03-11 Thread Cor
Aan: flashcoders Onderwerp: [Flashcoders] clean scripting hi just a semantic question really when writing your classes, would you only declare variables in the class and assign variables later or would you assign values straight away if you had them? so for instance, would you...: package

Re: [Flashcoders] clean scripting

2008-03-11 Thread Allandt Bik-Elliott (Receptacle)
they're both eager, though, aren't they? the only difference is that everything is instantiated in the first method of the class rather than in the class head a On 11 Mar 2008, at 18:10, Mark Lapasa wrote: Either way to me is a non-issue. However, it is an issue if I want to implement laz

Re: [Flashcoders] clean scripting

2008-03-11 Thread Mark Lapasa
Either way to me is a non-issue. However, it is an issue if I want to implement lazy instantiation. That is, instantiating objects only right before you need them. Thus, in your first example, the bulk of instantiation occurs up-front. Lazy instantiation http://www.javaworld.com/javawo

Re: [Flashcoders] clean scripting

2008-03-11 Thread Jer Brand
Not sure if this is correct for AS3, but I was under the impression that there was an actual performance penalty to doing things the first way (object creation and assignment in the class definition rather than in the methods or the constructor). Still, I like doing things the 2nd way, if only bec

RE: [Flashcoders] clean scripting

2008-03-11 Thread Matthew James Poole
ik-Elliott (Receptacle) Sent: 11 March 2008 17:41 To: flashcoders Subject: [Flashcoders] clean scripting hi just a semantic question really when writing your classes, would you only declare variables in the class and assign variables later or would you assign values straight away if you had the

[Flashcoders] clean scripting

2008-03-11 Thread Allandt Bik-Elliott (Receptacle)
hi just a semantic question really when writing your classes, would you only declare variables in the class and assign variables later or would you assign values straight away if you had them? so for instance, would you...: package com.receptacle.timeline { //package imports