I'm at a loss here. I copied this code straight off the adobe site:
http://livedocs.adobe.com/flex/3/html/help.html?content=05_Display_Programming_29.html
And copied it write into a new mxml project (below) and Flex is throwing 1120
erorrs saying "circle is undefined". How can that be?
******************************************************************
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
var circle:Sprite = new Sprite();
circle.graphics.beginFill(0x990000);
circle.graphics.drawCircle(50, 50, 50);
circle.graphics.endFill();
addChild(circle);
function fadeCircle(event:Event):void{
circle.alpha -= .05;
if (circle.alpha <= 0){
circle.removeEventListener(Event.ENTER_FRAME, fadeCircle);
}
}
function startAnimation(event:MouseEvent):void{
circle.addEventListener(Event.ENTER_FRAME, fadeCircle);
}
circle.addEventListener(MouseEvent.CLICK, startAnimation);
]]>
</mx:Script>
</mx:Application>