DrGoomba
01-29-2007, 07:36 AM
I have a custom class (MovieController) which retrieves data from a database and returns the results as an arrayCollection. There are multiple components which need to be able to access this collection. What would be the best way to share the same data among components?
Ideally i would like to do something such as:
import controller.movie.MovieController;
private var cntrlMovie:MovieController;
[Bindable]
private var movieCollection:ArrayCollection = new ArrayCollection;
private function dataLoaded(e:Event):void {
this.movieCollection = cntrlMovie.movieCollection;
}
An event is dispatched after the movieCollection is populated, then have this.movieCollection populate with that movieCollection.
Or
Create a custom event which passes the entire arrayCollection to any eventListeners listening for that event. Although these collections can contain thousands of records, i would think this would become problematic. Im not really sure.
Ideas? Recommendations? Thanks!!
Ideally i would like to do something such as:
import controller.movie.MovieController;
private var cntrlMovie:MovieController;
[Bindable]
private var movieCollection:ArrayCollection = new ArrayCollection;
private function dataLoaded(e:Event):void {
this.movieCollection = cntrlMovie.movieCollection;
}
An event is dispatched after the movieCollection is populated, then have this.movieCollection populate with that movieCollection.
Or
Create a custom event which passes the entire arrayCollection to any eventListeners listening for that event. Although these collections can contain thousands of records, i would think this would become problematic. Im not really sure.
Ideas? Recommendations? Thanks!!