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

Global data in Flash Builder

New Here ,
Feb 27, 2012 Feb 27, 2012

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.

Views

1.5K

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 ,
Feb 29, 2012 Feb 29, 2012

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.

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 ,
May 24, 2012 May 24, 2012

Copy link to clipboard

Copied

LATEST

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.

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