Hi,
this is rather complicated.
I have a DataGrid, in one of its column I call an ItemRenderer that 
creates a list of colored images side by side.
All I need is to catch the event when I hover over every inner cell 
image (remember, in a cell I have few images, each one should fire 
different event).
How do I trigger a function in my renderer?

My ActionScript renderer:
package
{

        import mx.collections.ArrayCollection;
        import mx.containers.HBox;
        import mx.controls.Image;
        import mx.controls.Alert;

        public class imageRenderer extends HBox 
        {                                                       
                public function imageRenderer():void{
                        super();
                        this.setStyle("paddingBottom",1);
                        this.setStyle("paddingTop",1);
                        this.setStyle("horizontalGap",1);

                }
                         
// Here I create the colored images I place in HBox in the cell
        
         override public function set data(value:Object):void {
        
               if (value != null)
                {
                removeAllChildren();
                for (var i:int = 0; i < value.Actual.length; i++){
                  var img:Image = new Image();      
                  img.source = value.Actual[i].image;      
                  img.id = "image - " +i;
                  img.height = 20;      
        //        img.toolTip=value.Actual[i].width;
                  img.percentWidth=value.Actual[i].width;       
                  img.maintainAspectRatio=false;
                  addChild(img);                
                }     
              }
        }                               
    }
}

I dont want to use flex tooltip, I need to place my own and for that 
I need an event for each of the images seperatly.

Thanks for the help

Jo

--- In flexcoders@yahoogroups.com, Jeffry Houser <j...@...> wrote:
>
> 
>  What problems did you have trying to accomplish this? 
> 
>  Without testing anything, I would expect the DataGrid to 'capture' 
the 
> mouseOver event as opposed to the itemRenderer component.  So, I'd 
> expect you'd need some way to trigger a function in the renderer 
based 
> on the DataGrid mouseOver . 
> 
>  But, this is just my first guess. 
> 
> yossi.baram wrote:
> > Hi,
> > I have some images in a DataGrid cells and I need to chatch the 
event 
> > when I hover on them.
> > The images are created in an ItemRenderer AC, so it has to be 
done 
> > there, raising an Alert for example.
> >
> > Thanks
> >   
> 
> 
> -- 
> Jeffry Houser, Technical Entrepreneur
> Adobe Community Expert: http://tinyurl.com/684b5h
> http://www.twitter.com/reboog711  | Phone: 203-379-0773
> --
> Easy to use Interface Components for Flex Developers
> http://www.flextras.com?c=104
> --
> http://www.theflexshow.com
> http://www.jeffryhouser.com
> --
> Part of the DotComIt Brain Trust
>


Reply via email to