I am relatively new to the Flex 4 platform (only two three months under my belt). I will cut it short and get to the point
<mx:TabNavigator....
<s:NavigatorContent...
<s:BorderContainer width="522"
height="138"
id="fstCont4"
backgroundAlpha="0"
dropShadowVisible="true"
x="568.25" y="177.1">
<s:layout>
<s:HorizontalLayout gap="0" verticalAlign="middle"/>
</s:layout>
<s:Label text="Lahore PIE"
rotation="-90"
fontWeight="normal"
fontFamily="Arial"
fontSize="18"
verticalAlign="middle"
textAlign="center"
fontStyle="normal"/>
<mx:Image id="lhrPIE"
width="506"
height="138"/>
<s:Button height="25" width="25" rotation="90" click="lhrPIE_Refresh_clickHandler(event)"/>
</s:BorderContainer>
</s:NavigatorContent>
</mx:TabNavigator>
I have a contentCreationComplete event on NavigatorContent... and once that is fired i load some img's into the mx Image component. I have many of these BorderContainer inside the NavigatorContent container and hence a lot of images are loaded in ContentCreation function.
I have also added a button component to the BorderContainer component so that the users can manually reload a specific img from the many BorderContainer + img combos. The click event as mentioned just loads the img into the img block. Problem is i donot want to write event handlers for all the buttons.
how can i make a generic function..
i have a feeling that it would be something like
protected function imgRefresh_clickHandler(event:MouseEvent):void { this.lhrPIE.load("...."); }
How can i make this function generic and reference the img block of each Container generically without referencing the ID ( which are off course unique thought the app for each img block)