Reputation: 3274
What's the call analogous to creationComplete
that happens every time a component is rendered? I want to rerun a function every time the component gets rendered (it has to make an HTTP request, but the url it calls changes each time) and I can't figure out how to do it.
For context:
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%"
creationComplete="loadGallery()">
private function loadGallery():void {
var src:String = "http://localhost:3000/car_type/" + UserPreference.getInstance().carType.toString() + ".xml";
Alert.show(src);
httpService.url = src;
httpService.send();
}
Upvotes: 1
Views: 1554
Reputation: 6059
I would override the updateDisplayList method for the component and add a call to your loadGallery method there.
Hope that helps.
Upvotes: 1
Reputation: 8875
http://docs.huihoo.com/flex/4/flash/display/DisplayObject.html#event:render maybe?
Upvotes: 0