Hello all, I am having a problem. I am using drag and drop and want to add an
event listener on objects that a mouse is over. So I have this panel and then
I add a label and maybe a button to the panel. I then attach to the panel,
label and button an event listener mouse over to get the class name to what the
mouse is hovering over.
If I then hover over the label, I get the class name "Label" then "Panel", here
is my simple test code:
<mx:Script>
<![CDATA[
public function INIT():void
{
}
public function EVC(e:Event):void
{
trace(e.currentTarget.className);
}
]]>
</mx:Script>
<mx:Panel x="58" y="108" width="417" height="355"
mouseOver="EVC(event)">
<mx:Button label="Button" mouseOver="EVC(event)"/>
<mx:Label text="Label" mouseOver="EVC(event)"/>
<mx:TextInput mouseOver="EVC(event)"/>
</mx:Panel>
So when I hover anything that is contained within the panel I get that objects
class name and the panels class name. How can I just get the class name of
what I am hovering over? If I hover the panel and only the panel (lets say in
the title bar) then I want to return className = Panel but if I hover anything
else I want that class name.
Can this be done?
Thanks for the help,
timgerr