Loading a SWF of stars. I would like the stars SWF to alpha in as the sky darkens. I think I am close as the following has the stars alpha at 0, but the changeAlpha is not occurring.
var myLoader:Loader = new Loader(); addChild(myLoader);
myLoader.alpha=0;
var url:URLRequest = new URLRequest("RealisticStars.swf");
myLoader.load(url);
function completeHandler(event:Event):void
{
var myLoader:Loader=event.currentTarget.content.parent as Loader;
myLoader.addEventListener(Event.ENTER_FRAME, changeAlpha);
}
function changeAlpha(event:Event):void
{
var myLoader:Loader=event.currentTarget as Loader;
if(myLoader.alpha < 1)
{
myLoader.alpha+=0.1;
}
else
{
myLoader.alpha=1;
myLoader.removeEventListener(Event.ENTER_FRAME, changeAlpha);
}
}