HI all.
maybe my question fits here.

here it goes. I have an object A of some king and object b of same
kind as A..

if I make B.someproperty = A.someproperty and then make changes to be
property in B, such has, B.someproperty = "something", why do the
someproperty in A also changes?

Any way to get around this?

a common case is, if I have  Object A of array collection with 1000
objects inside, and i want to create a Object B of array collection,
and want B to have all the 1000 values that A has i will do B = A,
instead of running the A array and push each value into B.

The problem is same as above, if then i push another value on B
(A.length would be 1001) the same value will be pushed to A array
(A.length = 1001)!! 

Is this normal? Or is there a way in flex to say that i Want B to have
same content as A, but then change B without affecting A?

Thanks

Lucas



--- In [email protected], "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> On your second question, regarding refreshing the screen, the ideal
> solution is to use data binding.  If your screen elements are bound to
> some dataProvider, and that dataProvider changes, the screen elements
> will automatically refresh, no programattic work is necessary.
> 
>  
> 
> In your tab example, you should only need to "refresh" the data if it
> changes, and binding will handle that for you.
> 
>  
> 
> Do you need to explicitly refresh your data model every time the user
> navigates between tabs?  Do that on a navigation event, and your bound
> field/elements will update automatically
> 
>  
> 
> Tracy
> 
>  
> 
> ________________________________
> 
> From: dmitriy_orlovskiy [mailto:[EMAIL PROTECTED] 
> Sent: Monday, July 26, 2004 10:37 PM
> To: [email protected]
> Subject: [flexcoders] Re: global variable vs passing parameters to the
> cus tom components
> 
>  
> 
> Thank you very much for the response. 
> Does it mean that vars need to be defined in the script file that 
> has reference to the Application tag?
> Is parentApplication property is the same as accessing data this way:
> mx.core.Application.application.userObject.userId or is it different?
> 
> What is the good practice for refreshing data on the screen?
> creationComplete event for the container fires only once. Which 
> event in the container to use to referesh data from the database, 
> every time component becomes active? 
> Let's say there are multile tabs. Every time when tab is selected, 
> refresh data is needed. How to do that inside of the component 
> without using tab change event and broadcast it to the component 
> somehow? How to do that? 
> 
> Thank you
> 
> --- In [email protected], Gordon Smith <[EMAIL PROTECTED]> wrote:
> > The use of _global in Flex applications is generally discouraged. 
> Instead
> > you could store your user information in vars of the Application 
> object and
> > use the parentApplication property to access them from multiple 
> custom
> > components.
> > 
> > If the information needs to be accessed by many custom components, 
> this is
> > probably preferable to storing it redundantly in each component.
> > 
> > Another common pattern is to separate data from UI by having a 
> singleton
> > DataModel class for storing data.
> > 
> > - Gordon
> > 
> > 
> > -----Original Message-----
> > From: dmitriy_orlovskiy [mailto:[EMAIL PROTECTED] 
> > Sent: Monday, July 26, 2004 3:04 PM
> > To: [email protected]
> > Subject: [flexcoders] global variable vs passing parameters to the 
> custom
> > components
> > 
> > 
> > Hello,
> > Are there any advantages/disadvantages to use _global variables in 
> > flex? 
> > What is the difference between storing user information (that 
> needs 
> > to be retrieved only once) in _global variable vs to pass user 
> > information to the custom component as a custom property (with use 
> of 
> > the set methods and assigning it to local variable that will be 
> > stored inside of the component).
> > What would be prefered method in that case?
> > 
> > Thank you
> > 
> > 
> > 
> > 
> >  
> > Yahoo! Groups Links
> 
> 
> 
> 
> 
> Yahoo! Groups Sponsor
> 
> ADVERTISEMENT
> click here
> <http://us.ard.yahoo.com/SIG=129ntq3f3/M=295196.4901138.6071305.3001176/
> D=groups/S=1705007207:HM/EXP=1090982198/A=2128215/R=0/SIG=10se96mf6/*htt
> p:/companion.yahoo.com> 
> 
>  
> <http://us.adserver.yahoo.com/l?M=295196.4901138.6071305.3001176/D=group
> s/S=:HM/A=2128215/rand=684700556> 
> 
>  
> 
> ________________________________
> 
> Yahoo! Groups Links
> 
> *     To visit your group on the web, go to:
>       http://groups.yahoo.com/group/flexcoders/
>         
> *     To unsubscribe from this group, send an email to:
>       [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> 
>         
> *     Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service <http://docs.yahoo.com/info/terms/> .
>


Reply via email to