Copy link to clipboard
Copied
Hi,
I am trying to build a common array of objects. I am taking in data from the screen and adding to an array. Somehow when my temporary object is being built it updates the existing entry in the array so by the end all the entries are identical - not what I wanted. Here is the basic code -
zoneDetails.zonePlantET = eto;
zoneDetails.zonePlantType = plantType;
zoneDetails.zoneIrrigationEfficiency = ie;
zoneDetails.zoneIrrigationType = irrigationType;
zoneDetails.zonePlantWaterReq = waterReq;
zoneTemp = zoneDetails;
OK - edit is not working with me but zoneDetails is a public object and zoneTemp is a public array and I assure you i is incremented each go, but zoneTemp[0] gets updated to the [1] details before the assignment at the end .
Copy link to clipboard
Copied
I know you're having problems with formatting, but without seeing the full code, I think it's going to be hard to help you.
Note that this is more an Actionscript question than a Flash Builder one...
Copy link to clipboard
Copied
Thanks for the response – I have actually worked this out. I was not instantiating the array entry, just assigning to it. Once I fixed that it all worked fine.