Try this... you need to make sure you call the code after thepage is created via creationComplete="init()".<?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"xmlns="*" layout="vertical" creationComplete="init()"><mx:Script><![CDATA[import flash.events.Even...