• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Array object entry getting updated strangely

New Here ,
Jun 28, 2012 Jun 28, 2012

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 .

Views

474

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jul 02, 2012 Jul 02, 2012

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...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 03, 2012 Jul 03, 2012

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines