Use mx.utils.ObjectUtil class, this ObjectUtil has the method copy that will 
allow u to create a new array with the same values.

var arrayCopy=(ArrayCollection)ObjectUtil.copy(arraycollection);

 Thanks,


with Regards,
Jitendra Jain
Software Engineer
91-9979960798



----- Original Message ----
From: "Chilcoat, Dee" <[EMAIL PROTECTED]>
To: [email protected]
Sent: Friday, June 13, 2008 4:20:20 AM
Subject: [flexcoders] Need array example


I need an example of copying fields in an array to another
array, but I don’t want the fields to be pass-by-reference.  I’m
trying to create a “holding”array for input in a datagrid.  This
is code I have used.  
 
                        holdData[6]
= quickEntryGrid. dataProvider[ i].timerecordTrc PayRateAmount;
         
        holdData[7] =
quickEntryGrid. dataProvider[ i].timerecordTrc SickLeaveHours;
         
        holdData[8] =
quickEntryGrid. dataProvider[ i].timerecordTrc VacationHours;
       
          holdData[9] =
quickEntryGrid. dataProvider[ i].timerecordTrc RegularHours;
         
        holdData[10] =
quickEntryGrid. dataProvider[ i].timerecordTrc StraightOvertmHo urs;
         
        holdData[11] =
quickEntryGrid. dataProvider[ i].timerecordTrc PremiumOvertmHou rs;
         
        holdData[12] =
quickEntryGrid. dataProvider[ i].timerecordTrc OtherHours;
         
        holdData[13] =
quickEntryGrid. dataProvider[ i].timerecordTrc OtherHoursCode;
                        holdRowData[ i]
= holdData;
 
The problem is that whenever a user inputs data into the
quickEntryGrid, it is reflected in the holdRowData, which I need to contain the
original values before the user enters any data.  If I can’t use a holding
array, do I have other options?
 
Dee
A. Chilcoat
Enterprise
Web Application Development
University
of California San Diego
[EMAIL PROTECTED] edu
(858)
534-0719    


      

Reply via email to