Hi
New to AS3 and just having one problem. I am using this code to load in my external swf’s with a preloader I’m using the tweens to just fade in and out my swf’s, works well.
This is my code
var movieLoad:Loader = new Loader();
var movieURL1:String = "flash_work/projects/threeAxisMcCentre.swf";
var movieURL2:String = "flash_work/projects/sheetSteel.swf";
var movieReq1:URLRequest = new URLRequest(movieURL1);
var movieReq2:URLRequest = new URLRequest(movieURL2);
movieLoad.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler );
movieLoad.contentLoaderInfo.addEventListener(Event.COMPLETE, fileLoaded );
movieLoad.load(movieReq1);
holder_mc.addChild(movieLoad);
function progressHandler(event:ProgressEvent):void
{
var bytestotal = event.bytesTotal;
var bytesloaded = event.bytesLoaded;
var percentVar = Math.round(bytesloaded * 100 /bytestotal );
externalPreLoader_mc.gotoAndStop ( percentVar );
}
function fileLoaded(event:Event):void
{
removeChild( externalPreLoader_mc );
var myTween1:Tween = new Tween(holder_mc, "alpha",Back.easeOut,0,1,1,true);
}
//External Movie Loads
function loadInMovie1 (event:MouseEvent):void
{
var myTween2:Tween = new Tween(holder_mc, "alpha",Back.easeOut,1,0,1,true);
myTween2.addEventListener(TweenEvent.MOTION_FINISH, startLoad);
function startLoad (event:TweenEvent):void
{
addChild( externalPreLoader_mc );
movieLoad.load(movieReq1);
holder_mc.addChild(movieLoad);
}
}
But when I add this code to fade in my initial movie contents the whole swf just doesn’t work properly, well it does in flash but not in a web browser either locally or on a server.
This is the code I’m using to fade in my initial movie
//Fade in Actions (when the SWF first opens)
import fl.transitions.*;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
TransitionManager.start(nav_mc, {type:Fade, direction:Transition.IN, duration:6, easing:Strong.easeOut});
TransitionManager.start(movieBack_mc, {type:Fade, direction:Transition.IN, duration:6, easing:Strong.easeOut});
TransitionManager.start(secondaryNav_mc, {type:Fade, direction:Transition.IN, duration:6, easing:Strong.easeOut});
If I comment out this code the whole thing is fine but left in the external swfs just don’t fade in properly.
I would love to know why or an alternative way of fading in my items initallly. Not into OOP techniques yet btw.
Thanks very much