Hi, ive come across a strange problem, maybe.
Im loading in my main swf, which will take the place of the preloader(which consists of the entrance) like so…
var entrance:Entrance = new Entrance();
addChild(entrance);
import gs.TweenLite;
import gs.easing.*;
stage.addEventListener(Event.RESIZE, onStageResize);
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
function onStageResize(evt:Event):void
{
entrance.x = stage.stageWidth/2;
entrance.y = stage.stageHeight/2.4;
entrance.width = stage.stageWidth/5;
entrance.height = stage.stageHeight/1.7;
}
entrance.x = stage.stageWidth/2;
entrance.y = stage.stageHeight/2.4;
entrance.width = stage.stageWidth/5;
entrance.height = stage.stageHeight/1.7;
var req:URLRequest = new URLRequest("waterLight2.swf");
var loader:Loader = new Loader();
loader.load(req);
addChild(loader);
loader.alpha = 0;
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
function done(evt:Event):void
{
entrance.play()
addEventListener(Event.ENTER_FRAME, entranceHandler);
}
function entranceHandler(evt:Event):void
{
removeEventListener(Event.ENTER_FRAME, entranceHandler);
TweenLite.to(entrance, 1.5, {alpha:0, ease:Strong.easeIn});
addEventListener(Event.ENTER_FRAME, removeEntrance);
}
function removeEntrance(evt:Event):void
{
if (entrance.currentFrame == 30)
{
TweenLite.to(loader, 1.5, {alpha:1, ease:Strong.easeOut});
removeChild(entrance);
removeEventListener(Event.ENTER_FRAME, removeEntrance);
}
}
However, for some reason or other, my loaded swf isnt visible until i resize the stage.
Ive been trying various things with the way the preloading is done, but it doesnt seem to change anything, and also ive tried taking out the tweens but that doesnt do anything either.
Has anyone had this problem before? If so, some advice would be much appreciated.