Jump to content
Search Community

Loading external swf (and controlling it's timeline)!

sondanz test
Moderator Tag

Recommended Posts

I really need some help on this!

 

I am trying to load an external swf as soon as my movie start. That works fine. Then I want it to pause as soon as it loads. That works fine.

 

But then I need another function to tell that external swf to play. That's what I can't figure out! My playMorph function is all jacked up! What am I doing wrong?!?!

 


// function to load the external morph.swf
var morpher:LoaderMax=new LoaderMax();
function loadMorph():void{
morpher.append(new SWFLoader("www.website.com/morph.swf", {container:boy}));
morpher.load();
morpher.pause();
}


function playMorph():void{
morpher.play();
}

/////////////////////////////////////////////////////////////////////////////////////////////////

// import the tween engine
import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.loading.*;

/////////////////////////////////////////////////////////////////////////////////////////////////

// main timeline
var timeline:TimelineLite = new TimelineLite();

timeline.appendMultiple([
	TweenLite.to(facebook,					1, {alpha:.2, ease:Expo.easeOut, delay:1, onComplete:loadMorph}),
TweenLite.from(text1,					1, {alpha:0, ease:Expo.easeOut, delay:1})]);

timeline.appendMultiple([
TweenLite.to(text1,						1, {alpha:0, ease:Expo.easeOut, delay:2}),
TweenLite.from(boy,						1, {alpha:1, ease:Expo.easeOut, delay:2, onComplete:playMorph})]);

Link to comment
Share on other sites

your swf size and connection speed is going to determine how fast the file will load. LoaderMax can't do anything to speed up a loading process. If you are noticing a delay you may want to set auditSize to false.

 

auditSize : Boolean - By default, when the LoaderMax begins to load it quickly loops through its children and if it finds any that don't have an estimatedBytes defined, it will briefly open a URLStream in order to attempt to determine its bytesTotal, immediately closing the URLStream once the value has been determined. This causes a brief delay initially, but greatly improves the accuracy of the progress and bytesTotal values. Set auditSize to false to prevent the LoaderMax from auditing its childrens' size (it is true by default).

 

http://www.greensock.com/as/docs/tween/ ... erMax.html

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...