He meant that the line:

my_array.push(z)=z;

should be:

my_array.push(z);

You're right about recreating the array, you could leave out the delete
my_array and just overwrite it with new Array().

Adrian

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Cristo @
cryzto.ch
Sent: 18 May 2007 00:31
To: 'Rákos Attila'; [email protected]
Subject: AW: [Flashcoders] - Array memory performance


Thnx for the info Attila.

Well my plan was to fill up the array with object's-name that are visible in
the configurator (active ones) cause the invisibles ( _alpha = .25 ) are not
important for the user (inactive ones).

The thing with the low-level memory ist hat I don't know how Flash handles
it, in C++ the Developer ist he one to manage that problem. But I guess u're
saying it works more or less like Java (with a garbage-collector) since it
works on VM.

>> Yes, it is wrong of course, since only a variable or property can be
>> on the left side of an assignment. What do you want to do with this?
>> I don't understand it at all. push() returns the new length of the
>> array - what do you want to assign to it?

Sorry, but I don't know which assignement you exactly refer to, do you mean
" my_array.push(z)=z; "?

It's only a test-code to show me a value has been stored in the array.

Thnx 4 that quick answer Attila.

Cryzto ;-)

-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Im Auftrag von Rákos
Attila
Gesendet: Freitag, 18. Mai 2007 00:27
An: Cristo @ cryzto.ch
Betreff: Re: [Flashcoders] - Array memory performance


Ccc> Is in the following code something wrong:
Ccc>
Ccc> var my_array:Array = new Array();
Ccc>
Ccc> for (var z=0; z<x; z++){
Ccc> my_array.push(z)=z;
Ccc> }

Yes, it is wrong of course, since only a variable or property can be
on the left side of an assignment. What do you want to do with this?
I don't understand it at all. push() returns the new length of the
array - what do you want to assign to it?

Ccc> I’m rather skilled in C++, and there I have to do that for not
overfilling
Ccc> dynamic memory (heap)!

What do you have to do there? In general you don't have to care about
low-level memory management in Flash at all, the VM is responsible for
such tasks.

Ccc> I want to fill up an array and later empty it so i can fill it again
from
Ccc> scratch, Important is I don’t want to empty the array element by
element
Ccc> using a loop.

No loop is required, a simple splice(0) is enough. Or you can create a new
array instance, too - of course.

  Attila

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to