Oops…

 

Thanks guys, but no luck (constructor ok, but ‘+=’ fails).

 

Looks like “vec[0] += 123“ resets the array to length = 1, rendering vec[1] and vec[2] to undefined…

 

Weird.

 

T

 


Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens JesterXL
Verzonden: maandag 28 november 2005 22:48
Aan: Open Source Flash Mailing List
Onderwerp: Re: [osflash] class extends Array woes

 

...or just call super; Array's constructor supports arrrrrrrrrrrrrrrgs.

 

super(x, y, z);

 

----- Original Message -----

Sent: Monday, November 28, 2005 4:32 PM

Subject: Re: [osflash] class extends Array woes

 

just as a tangent, have you considered using push() in the constructor??

 

 

class Vec3D extends Array {

    function Vec3D(x, y, z) {

        this.push(x);     

        this.push(y);    

        this.push(z);    

    }

}

 

I know it sound wierd, but there may be an issue with addressing a not yet existent property inside the constructor function... or maybe I am just spacing.

 

julian

 

 



 

On 28.11.2005, at 22:25, Tim Knip wrote:



Why are you extending Array? Why not have a class with 3 fields: x, y, z?

 

 

The code is part of a 3D-engine. Array-access is supposed to be faster then

Object-prop-access (did some testing on it). 

 

Essence: code works in 7 but not in 8... why?

 

Btw: I agree that extending Array is bit silly... :-)

T

 

 

-----Oorspronkelijk bericht-----

Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Namens

David Karam

Verzonden: maandag 28 november 2005 22:17

Aan: 'Open Source Flash Mailing List'

Onderwerp: Re: [osflash] class extends Array woes

 

Why are you extending Array? Why not have a class with 3 fields: x, y, z?

 

 

 

-----Original Message-----

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On

Behalf Of Tim Knip

Sent: Monday, November 28, 2005 12:49 PM

To: 'Open Source Flash Mailing List'

Subject: [osflash] class extends Array woes

 

Hi list,

 

Sorry for this slight OT post, but I'm going nuts:

I have a class extending Array:

 

- + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + class Vec3D

extends Array {

    function Vec3D(x, y, z) {

        this[0] = x;     this[1] = y;    this[2] = z;    

    }

}

 

- - - - - - - - - - - - - - - - - -

var v:Vec3D = new Vec3D(0,0,0);

 

v[0] += 100;  // result as expected: 100 v[1] += 100;  // NaN in F8 !!???

works in F7 v[2] += 100;  // NaN in F8 !!??? Works in F8

 

- + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +

 

Am I doing something *really* stupid here? 

Or did something change in F8 (must be, cause works in 7)?

 

Thanks,

Tim Knip

 

 

 

-----Oorspronkelijk bericht-----

Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Namens

Nicolas Cannasse

Verzonden: maandag 28 november 2005 17:29

Aan: Open Source Flash Mailing List

Onderwerp: Re: [osflash] Using components in FAME development

 

Igor V. Sadovskiy wrote:



Hello Justin.

 

I have the same issue.

 

I've reported it to Nicolas about a month ago and it's already in his 

TODO list. But it seems he is working on HaXe now and have no a lot of 

time to work on MTASC's fixes...

 

Igor

 

 

Just took some time to fix it on CVS :)

 

Nicolas

 

_______________________________________________

osflash mailing list

 

 

 

 

_______________________________________________

osflash mailing list

 

 

 

_______________________________________________

osflash mailing list

 

 

 

 

_______________________________________________

osflash mailing list

 

 


_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to