Define variable in click event handler
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script> private function debugThis():void { var myVar:Number=1; } </mx:Script> <mx:Button id="debugButton" label="Debug" click="debugThis()"/> </mx:Application>