Re: [Flashcoders] Flash Class Array bug - Please verify

2005-12-29 Thread ryanm
The thing that bothers me is that no one seems to care if this is a bug or not. It shouldn't, it's been discussed at least a hundred times here already, and it's not a bug. Don't initialize class variables in the class defenition, it adds them to the prototype. Initialize them in the const

Re: [Flashcoders] Flash Class Array bug - Please verify

2005-12-29 Thread JesterXL
s in your class, and initialize in your constructor or init functions, and you'll never have problems. - Original Message - From: "Judah Frangipane" <[EMAIL PROTECTED]> To: "Flashcoders mailing list" Sent: Thursday, December 29, 2005 5:56 PM Subject: Re: [Flashcod

Re: [Flashcoders] Flash Class Array bug - Please verify

2005-12-29 Thread Judah Frangipane
type_array.push("foo_d"); trace(foo.prototype_array); // b, foo_d trace(bar.prototype_array); // b, foo_d - Original Message - From: "JesterXL" <[EMAIL PROTECTED]> To: "Flashcoders mailing list" Sent: Thursday, December 29, 2005 3:39 PM Subject: Re: [Flashcoder

Re: [Flashcoders] Flash Class Array bug - Please verify

2005-12-29 Thread elibol
OTECTED]> > To: "Flashcoders mailing list" > Sent: Thursday, December 29, 2005 3:39 PM > Subject: Re: [Flashcoders] Flash Class Array bug - Please verify > > > Nope, they are prototype scoped arrays, not static. > > AS1: > function MyClass(){} > > AS2: &

Re: [Flashcoders] Flash Class Array bug - Please verify

2005-12-29 Thread ryanm
Flash is still treating the array as a static member. It isn't static, but it is being assigned the array object in the prototype, which acts sort of like a static member. You need to assign (initialize) it in the constructor, rather than in the member defenition. ryanm

Re: [Flashcoders] Flash Class Array bug - Please verify

2005-12-29 Thread Judah Frangipane
ot; Sent: Thursday, December 29, 2005 3:39 PM Subject: Re: [Flashcoders] Flash Class Array bug - Please verify Nope, they are prototype scoped arrays, not static. AS1: function MyClass(){} AS2: class MyClass{} AS1 - static: MyClass.my_array = []; AS2 - static: class MyClass { stat

Re: [Flashcoders] Flash Class Array bug - Please verify

2005-12-29 Thread Nathan Derksen
Yes, when you assign an initial value to a property, it is basically like a static assignment. Do the initialization in the constructor instead. This works for me: class myClass { // initialize the array in the declarations var myArray:Array; function myClass() { myArray =

Re: [Flashcoders] Flash Class Array bug - Please verify

2005-12-29 Thread JesterXL
oint to it foo.prototype_array.push("foo_d"); trace(foo.prototype_array); // b, foo_d trace(bar.prototype_array); // b, foo_d - Original Message - From: "JesterXL" <[EMAIL PROTECTED]> To: "Flashcoders mailing list" Sent: Thursday, December 29, 2005

Re: [Flashcoders] Flash Class Array bug - Please verify

2005-12-29 Thread Judah Frangipane
Hi Glenn, Flash is still treating the array as a static member. // treated as an instance variable var myArray1:Array; // treated as a static variable var myArray2:Array = new Array(); Test this code: // in actions frame 1 import myClass trace("Creating instance a") var a = new myClass(); a.a

Re: [Flashcoders] Flash Class Array bug - Please verify

2005-12-29 Thread JesterXL
Nope, they are prototype scoped arrays, not static. AS1: function MyClass(){} AS2: class MyClass{} AS1 - static: MyClass.my_array = []; AS2 - static: class MyClass { static var my_array:Array = []; } AS1 - prototype: MyClass.protoytpe.my_array = []; AS2 - prototype: Same as above, or: cla

RE: [Flashcoders] Flash Class Array bug - Please verify

2005-12-29 Thread Glenn J. Miller
Yeah... that's a good point too... LOL Peace... -- Dok Skyymap, Inc. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nathan Derksen Sent: Thursday, December 29, 2005 3:33 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Flash Class Arra

RE: [Flashcoders] Flash Class Array bug - Please verify

2005-12-29 Thread Glenn J. Miller
ay.push(10); this.myArray.push(20); } } Peace... -- Dok Skyymap, Inc. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Glenn J. Miller Sent: Thursday, December 29, 2005 3:33 PM To: 'Flashcoders mailing list' Subject: RE: [Flashcoder

Re: [Flashcoders] Flash Class Array bug - Please verify

2005-12-29 Thread Nathan Derksen
I think you are missing the () in the constructor statement: function myClass { trace("myArray.length="+myArray.length) } Should be: function myClass() { trace("myArray.length="+myArray.length) } Nathan http://www.nathanderksen.com On Dec 29, 2005, at 12:30 PM, Judah Frangipane w

RE: [Flashcoders] Flash Class Array bug - Please verify

2005-12-29 Thread Glenn J. Miller
Hey Judah, Try this: class myClass { // initialize the array in the declarations private var myArray:Array = new Array(); function myClass { trace("myArray.length="+this.myArray.length) } public function addToArray() { this.myArray.push(10); this.myArray