In your ProductThumb declare a listOwner property, it should be set to the TileList automatically by the time setValue is called.  Then for those events you should go ahead and tell the listOwner to dispatch a new event, passing in any relevant info.  You can then have your code addEventListener on the TileList for those events (just do it in the creationComplete of the TileList).

 

Matt

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Fernando Barros
Sent: Friday, October 07, 2005 4:30 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] tileList and events

 

Hi there,

I think, not sure ;), this is a simple question, but I am little
confused how implement it.
In my ProdutoThumb, I have a TextInput, NumericStepper and I will have a
button. What is the best way to get the respective events in my app? I
mean, how I will get the change in the textInput, NumericStepper and the
click on the button.

Tks!

Fernando


****************
My app:

<mx:TileList selectionColor="#FFFFFF" rollOverColor="#FFFFFF"
                              id="list" width="100%"
height="100%" dataProvider="{objProdutoProposta}"
cellRenderer="ProdutoThumb" itemWidth="500" itemHeight="90"
                              dragEnter="doDragEnter(event)"
                              dragExit="doDragExit(event)"
                              dragDrop="doDragDrop(event)"
                              dragOver="doDragOver(event)"
     
dragComplete="doDragComplete(event)"
                              />



*****************
ProdutoThumb.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.macromedia.com/2003/mxml" width="100%"
height="100%">

      <mx:Script>
            <![CDATA[
                  var objProduto: Object;
                  function setValue(str: String, item: Object){
                        if (item == undefined){
                              visible = false;
                              return;
                        }
                        else{
                              objProduto = item;
                              visible = true;
                        }
                  }
                 
            function hideWhenChanging()      {
                  image.addEventListener("contentPathChanged",
mx.utils.Delegate.create(image, function() { this.visible=false; }));
            }
           
            ]]>
      </mx:Script>
     
      <mx:Canvas width="20%" height="80" clipContent="false">
            <mx:Image width="90%" id="image" visible="false"
source="/images/produtos/{objProduto.SPRODUTOIDOFFICER}"
complete="event.target.visible=true;"
creationComplete="hideWhenChanging()"/>
      </mx:Canvas>
     
      <mx:VBox width="80%" height="80">
            <mx:Label textAlign="left" text="{objProduto.STITULO}"
width="100%"/>
            <mx:HBox width="100%">
                  <mx:Label text="Qtde:" width="15%"/>
                  <mx:Label text="Vl.Rev.Unit." width="35%"/>
                  <mx:Label text="Vl.Cli.Unit." width="50%"/>
            </mx:HBox>
            <mx:HBox width="100%">
                  <mx:NumericStepper value="{objProduto.NQTDE}"
minimum="1" maximum="150" width="15%" />
                  <mx:Label text="{objProduto.NVLREVENDAUNIT}"
width="35%"/>
                  <mx:TextInput id="txtVlCliente"
text="{objProduto.NVLCLIENTEUNIT}" textAlign="right" width="50%"/>
            </mx:HBox>
      </mx:VBox>

</mx:HBox>



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to