more traditional event listener stuff

This commit is contained in:
Dan Buch 2010-02-19 16:05:23 -05:00
parent be31565c47
commit a1f814a294
2 changed files with 1 additions and 4 deletions

View File

@ -1,17 +1,14 @@
package package
{ {
import mx.core.Application; import mx.core.Application;
import mx.controls.Button;
import flash.events.MouseEvent; import flash.events.MouseEvent;
public class CustomApp extends Application public class CustomApp extends Application
{ {
public var mutton:Button;
function CustomApp() function CustomApp()
{ {
mutton.addEventListener(MouseEvent.CLICK, butterCup);
} }
public function butterCup(event:MouseEvent):void public function butterCup(event:MouseEvent):void

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<me:CustomApp xmlns:mx="http://www.adobe.com/2006/mxml" <me:CustomApp xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:me="*" layout="absolute"> xmlns:me="*" layout="absolute">
<mx:Button id="mutton" label="howdy" /> <mx:Button id="mutton" label="howdy" click="butterCup(event)" />
</me:CustomApp> </me:CustomApp>