Copy link to clipboard
Copied
OK I admit I am a low level programmer but I need to build a set of data through several views in Flash Builder. I have gone down the singleton rabbit hole but would really appreciate a simple guide to persisting/updating data through an application.
Copy link to clipboard
Copied
Hi,
That's a 'big' question. One way to do this is to use a public array variable such as:
public var appParams:Array=new Array;
appParams[0]=new Object; //--- User details
appParams[0]['username']=myUser;
appParams[0]['displayname']=myUserFullname;
appParams[1]=new Array; //--- Shopping cart (whatever!)
appParams[1][0]=new Object;
appParams[1][0]['productname']=myProductCode;
appParams[1][1]=new Object;
appParams[1][1]['productname']=myOtherProductCode;
And so on.
There are some very 'clever' ways to do what your ask, but using Arrays generally reduces the amount of code required in an app.
m.
Copy link to clipboard
Copied
Hi mtdevuk - I feel very rude since I have not revisited this post. I got this all working through singleton arrrays. The real deal was to get some understanding of the getInstance code - the persistance was the thing. Thanks for the update.