I am currently developing a mobile application using the latest version of Flash Builder and I need to create a Global ArrayCollection to store information in that is pulled from a local DB. I can pull back the data from the DB fine however I cannot seem to access the Global variable when I try. I have the follng .as file called “Model.as” which is located in a folder called valueObjects and that file contains the following code:
package valueObjects
{
import flash.data.SQLConnection;
import mx.collections.ArrayCollection;
public class Model
{
public var ids:ArrayCollection = new ArrayCollection();
public function Model()
{
}
}
}
Now I want to start populating this ArrayCollection with the info from the database so i import the class into the Default Package mxml doc which will be loaded up first when the app starts by using:
import valueObjects.Model;
Then in a private function I try to access the ids ArrayCollection and populate it however I get the following error:
-1120: Access of undefined property ids.
-Access of undefined property ids
Can anyone please help with this?? Thanks
Or easiest way is make array static.
but for this case is Singleton way better.