-
1. Re: 2 vars for the same SWF Loader?
Andrei1 Oct 8, 2012 1:13 PM (in response to nikolaig)What is SWFLoader? Where does this class coming from? Is it Flex SWFLoader?
-
2. Re: 2 vars for the same SWF Loader?
nikolaig Oct 8, 2012 1:32 PM (in response to Andrei1)Hi, thanks for answering my post.
SWF loader comes from greensock.com platform
Just in case here is full code for the loader which I have used:
var loaderProductPopUps:SWFLoader;
if (loaderProductPopUps){
if(loaderProductPopUps.content){
loaderProductPopUps.unload();
}
}
loaderProductPopUps = new SWFLoader(sourceVar_ProductsPopUps, //the value of sourceVar_ProductsPopUps allows to load mulitple SWFs from the products page.
{
estimatedBytes:5000,
container:holderMovieClip,// more convinient and easier to manage if to place the LoaderMax into an empty mc (holderMovieClip)
// if not will work as well. Then the line container:holderMovieClip, has to be replaced with container:this,
// can be any size, can not be scaled as it distorts the content
onProgress:progressHandler,
onComplete:completeHandler,
centerRegistration:true,
//x:-260, y:-320, //no need for this is if used: centerRegistration:true,
alpha:1,
scaleMode:"none",
//scaleX:0, scaleY:0,
//vAlign:"top",
width:540,
height:730,//scales proportionally but I need to cut off the edges
crop:true,
autoPlay:false
});
function progressHandler(event:LoaderEvent):void{
progressBarPopUp_mc.gradientbar_appLoader_mcPopUp_mc.scaleX = loaderProductPopUps.progress;
}
function completeHandler(event:LoaderEvent):void{
var loadedImage:ContentDisplay = event.target.content;
//TweenMax.to(loadedImage, 1.5, {alpha:1, scaleX:1, scaleY:1});//only need this line if corresponding values are changed in SWF loader constructor
TweenMax.to(progressBarPopUp_mc, 1.5, {alpha:0, scaleX:0.25, scaleY:0.25});
}
loaderProductPopUps.load();

