DK
On 5/8/06, Douglas Knudsen <[EMAIL PROTECTED]> wrote:
> Ok, banging my head on this for far too long. I have a Flex app using
> a TileList and a custom ItemRenderer called ThumbNail.mxml.
> ThumbNail.mxml is composed of say two images, a up arrow and a down
> arrow for example. I really want to be able to make it so that if the
> user clicks on the up or down arrow, a event can be dispatched to the
> container the TileList lives in. I can't get this to work. So, say
> we have in main.mxml, i truncated this to only the drillUp case....I
> would expect that if the image in the Thumbnail component was clicked,
> a event would be dispatched up and the event listener in main.mxml
> would hear it.
>
> <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"
> height="100%"
> width="100%"
> creationComplete="initMe()">
>
> <mx:Script>
> <![CDATA[
>
> public function initMe():void {
> employees.addEventListener(MouseEvent.CLICK,handleChoice) ;
> }
>
> public function handleChoice( event:MouseEvent) : void {
> Alert.show('somethign was clicked...but what?');
> }
>
>
> </mx:Script>
>
> <mx:TileList
> id="employees"
> height="100%"
> itemRenderer="ThumbNail"
> dataProvider="{employeesDataIN}"
> width="100%"
> x="0" y="0"
> >
>
> </mx:TileList>
>
>
> </mx:HBox>
>
>
> and ThumbNail.mxml looks somethign like
>
> <mx:VBox>
>
>
> <mx:Metadata>
> [Event("drillUp")]
> </mx:Metadata>
>
> <mx:Script>
> <![CDATA[
> public function drillUp(event : Event) : void {
> dispatchEvent(new Event('drillUp',true));
>
> }
>
> </mx:Script>
>
> <mx:Image id="daDown" source="{upArrow}"
> mouseDown="drillUp( event )"
> toolTip="Click to drill up." />
>
>
> </mx:VBox>
>
>
>
> --
> Douglas Knudsen
> http://www.cubicleman.com
> this is my signature, like it?
>
--
Douglas Knudsen
http://www.cubicleman.com
this is my signature, like it?
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Web site design development | Computer software development | Software design and development |
Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.