Skip navigation
JDavi2001
Currently Being Moderated

Global data in Flash Builder

Feb 27, 2012 4:24 PM

Tags: #actionscript #global #variable #flash_builder_4.5

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.

 
Replies
  • Currently Being Moderated
    Feb 29, 2012 7:18 AM   in reply to JDavi2001

    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.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points