Jump to content
Search Community

Bad alpha edges when loading External SWF

davelassanske test
Moderator Tag

Recommended Posts

I am attempting to preload a SWF and place it in my stage. Everything seems to work great except when I alpha up the container containing the SWF, I see that the alpha edges have a lot of "scunge" around them. If I leave the alpha of the container at 100, there is no problem. Anyone have any thoughts or similar experiences?

 

Here's my code:

 

LoaderMax.activate([MP3Loader, SWFLoader, VideoLoader]);
var loader:XMLLoader = new XMLLoader("preloadlist.xml", {onComplete:completeHandler, estimatedBytes:50000, onProgress:progressHandler});
loader.load();

function hideDoodle(event:LoaderEvent):void {
ExternalInterface.call("showAds()");
container_entry.alpha=0;
Tweener.addTween(container_home,{alpha:100, time:1, transition:"easeOut"});
Tweener.addTween(doodle_mc,{alpha:0, time:.5, transition:"easeOut"});
Tweener.addTween(doodle_pad,{scaleX:0,scaleY:0, time:2, transition:"easeOut"});
}


function completeHandler(event:LoaderEvent):void {
var home_v6:SWFLoader = LoaderMax.getLoader("home_v6");
container_home.addChild(home_v6.content);
container_home.alpha=0;
setChildIndex(doodle_pad,2);
setChildIndex(container_home,1);

if (visited == "no") {
	//PLAY WELCOME VIDEO
	var video:VideoLoader = LoaderMax.getLoader("E1-ENTRY");
	container_entry.addChild( video.content );
	video.playVideo();
	video.addEventListener("videoComplete", hideDoodle);
}else{
	ExternalInterface.call("showAds()");
	Tweener.addTween(doodle_mc,{alpha:0, time:1, transition:"easeOut"});
	Tweener.addTween(container_home,{alpha:100, time:1, transition:"easeOut"});
	Tweener.addTween(doodle_pad,{scaleX:0,scaleY:0, time:2, delay:2, transition:"easeOut",onComplete:function(){container_home.vid_bottom.play();}});
}
   var queue2:LoaderMax = LoaderMax.getLoader("queue2");
   queue2.addEventListener(LoaderEvent.COMPLETE, queue2CompleteHandler);
   queue2.load();
}

 

Many thanks in advance. This is a great preloader!

Link to comment
Share on other sites

[GASP!] You posted on the GreenSock forums and you're using Tweener instead of TweenLite or TweenMax? How dare you! :)

 

Seriously, though, the problem looks like you're using an alpha of 100. In AS3, alpha goes from 0 to 1, not 0 to 100 like _alpha did in AS2.

 

Just curious: why have you opted to use Tweener instead of TweenLite/Max? Not that Tweener is bad or anything. I know it served a lot of people well for many years before it was retired (and still does).

Link to comment
Share on other sites

Thank you so much for your help. I am jumping into a project that was coded in AS2 and Tweener was used for all the motion. I'm tackling the preloader first as it wasn't really working properly in the first place and then I'll move everything else over to be more efficient and updated. I've been out of the actionscripting world for awhile so I will definitely look into TweenLite/Max.

 

Thanks again. Your reply did the trick.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...