The player's is-the-mouse-over-this-DisplayObject logic checks whether
the mouse is over a part of the DisplayObject that has been drawn into.
This lets a DisplayObject have non-rectangular hit areas.

If you haven't drawn into the Sprite, the mouse can't detect it at all.

If the Sprite has any background color (including white or the
background color or whatever), all of it has been drawn into, and the
whole thing is the hit area.

If you draw a circle or something into the sprite, you'll get a
mouseOver only for that circle.

But "drawn into" isn't the same as "visible". If you need a visually
transparent area that the mouse can detect, the trick is to draw into
that area with zero alpha! You can probably get this to happen by
setting backgroundAlpha="0" on your renderer.

- Gordon


-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Greg Morphis
Sent: Wednesday, January 04, 2006 1:00 PM
To: [email protected]
Subject: [flexcoders] Re: custom cell renderer onMouseover..

This is strange!!! If we set the backgroundColor then I can mouseOver
from the text to the image.. if we do not then the mouseOver only
works on the text..
WTF??
Is there a way for the cellrenderer to know what row the user is on
(in the below code)?
I suppose I could set the backgroundColor back to the row color
defined in the datagrid?

This sounds like a bug though...




On 1/4/06, Greg Morphis <[EMAIL PROTECTED]> wrote:
> We have a custom cellrenderer which on mouseover makes an icon appear
> which the user can click to remove that entry..
> A problem that we're seeing is that the mouseOver stopped right after
> the text ends. If we mouseOver the text we can see the icon, as soon
> as we move off of the text the icon disappears. I've tried adjusting
> the mouseOver/mouseOut events around but it's still occuring..
>
> Here's what we have for code.. any help would be appreciated..
>
> The container that calls the cellrenderer looks like...
>                 <mx:columns>
>                         <mx:Array>
>                                 <mx:DataGridColumn
>
cellRenderer="com.alltel.rapid.aopscheduler.view.WSEmployeeNameCellRende
rer"
> columnName="name" width="150" headerText="Employee"
> dataTipField="name" showDataTips="true"/>
> ...
>
>
> And the CellRenenderer looks like :
>
> <mx:HBox xmlns:mx="http://www.macromedia.com/2003/mxml";
>                  mouseOver="doMouseOver( event )"
>          mouseOut="doMouseOut( event )"
>          hScrollPolicy="off"
>          vScrollPolicy="off"
>          width="100%">
>
>
>
>         <mx:Script>
>         <![CDATA[
>
>                 import org.nevis.cairngorm.control.EventBroadcaster;
>                 import
com.alltel.rapid.aopscheduler.control.AOPSchedulerController;
>                 import
com.alltel.rapid.aopscheduler.model.ModelLocator;
>
>                 var isDefaultLocation : Boolean ;
>                 var emplid: String;
>                 //var isEditor: Boolean =
ModelLocator.employee.isInRole('editor');
>
>                 function setValue( str:String, item:Object,
sel:Boolean ) {
>
>                         dd.text =  item.isDefaultLocation ? str : '*'
+ str;
>                         this.isDefaultLocation =
item.isDefaultLocation;
>                         this.emplid = item.emplid;
>                         if(item.totalHours > 40)
>                                 dd.setStyle('color','red');
>                         else
>                                 dd.setStyle('color','black');
>
>                 }
>
>                 function doMouseOver( event )
>                 {
>                         if( ModelLocator.employee.isInRole('editor'))
>                         {
>                                 if(!isDefaultLocation)  {
>
>
event.target.addIcon.visible=true;
>
//event.target.styleName="employeeOn";
>                                 }
>                         }
>                 }
>
>                 function doMouseOut( event )
>                 {
>                         if( ModelLocator.employee.isInRole('editor'))
>                         {
>                                 event.target.addIcon.visible=false;
>
//event.target.styleName="employeeOff";
>                         }
>                 }
>
>                 function doMouseDown( event )
>                 {
>                         if( ModelLocator.employee.isInRole('editor'))
>                         {
>                                 if(!isDefaultLocation)  {
>
event.target.addIcon.visible=false;
>
event.target.styleName="employeeOff";
>                                         //broadcast event for
DeleteEmployeeFromScheduleCommand.as
>                                         var eventObject : Object = new
Object();
>                                         eventObject.emplid = emplid;
>
EventBroadcaster.getInstance().broadcastEvent(
> AOPSchedulerController.EVENT_REMOVEEMPLOYEEFROMSCHEDULE, eventObject
> );
>                                 }
>                         }
>                 }
>
>
>         ]]>
>         </mx:Script>
>
>         <mx:Label id="dd" toolTip="{ dd.text }"  />
>     <mx:Image id="addIcon"
>                 source="@Embed('/assets/images/icon_deleteblock.png')"
>                 visible="false"
>                 toolTip="Click the icon to delete this employee from
the schedule"
>                 mouseDown="doMouseDown( event )"
>                 mouseOver="doMouseOver( event )"
>          mouseOut="doMouseOut( event )" />
>
>
>
> </mx:HBox>
>
>
>
>
>
>
> --
> Auxilium meum a Domino
>


--
Auxilium meum a Domino


--
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



 




--
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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to