Your example threw a runtime error because yeahbaby() needs to take an
event as a parameter.
 
public function yeahbaby(event:MouseEvent):void {



________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of mossdude
Sent: Friday, September 28, 2007 1:31 PM
To: [email protected]
Subject: [flexcoders] What does it take to detect MOUSE_MOVE?



Why can't I catch mouse events with the stage? I verified that the
stage object exists before attaching the event listener, yet the event
handler never executes.

<mx:Application 
xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> "
width="1000" height="500">

<mx:Script>
import mx.controls.Alert;
import flash.events.MouseEvent;

public function go():void {
stage.addEventListener ( MouseEvent.MOUSE_MOVE, yeahbaby );
}

public function yeahbaby():void {
Alert.show ("Yeah, baby!");
}
</mx:Script>

<mx:Button id="go_btn" x="10" y="10" label="Go!" width="100"
click="go()" />

</mx:Application>



 

Reply via email to