Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Maxer

I Want To Load SWF Files Like Angry Birds !!!

Recommended Posts

Hi everyone and good morning... it's morning in my country! Pretty sure that everyone of you guys had played Angry Birds before... This game has a menu consisted of some boxes... You can't have access to next box whether you completed the previous one...Actually next boxes are locked; till you have completed previous one... (attached image)

Now consider these boxes as buttons that load SWF files. When loaded SWF file reach its last frame it shows an "unlocked next box" and then save this situation. I want to create such a complex menu, but as I'm new to as3 and LoaderMax I NEED SOME HELP PLEASE >>>

 

Problem 1: SWF files that should be load are not created with adobe flash

 

Problem 2: How To Detect Last Frame of Loaded SWF File in LoaderMax? Maybe if I Can Trace That it is reached the last frame I can solve this ...

 

Any Any Any Suggestions are EXTREMELY appreciated...Thanks a lot

post-40280-0-95535100-1448525322_thumb.png

  • Like 1
Link to post
Share on other sites

Hi and welcome to the GreenSock forums,

 

I really don't know what problems you can expect loading swfs that weren't created using Flash.

 

As for detecting when a loaded swf is done playing, that isn't a responsibility of LoaderMax.

You can write ENTER_FRAME handler though that checks to see if the swf that is currently playing has its playhead on the last frame by checking if the swfs currentFrame is equal to its totalFrames

addEventListener(Event.ENTER_FRAME, trackSWFPlayback);

function trackSWFPlayback(e:Event):void {
//trace(currentLoader.rawContent.currentFrame);


//detect if the loaded swf is on the last frame


if (currentLoader.rawContent.currentFrame == currentLoader.rawContent.totalFrames) {


trace("swf done");


//hide and stop current swf
currentLoader.content.visible = false;


currentLoader.rawContent.stop();




        //set up and play the next swf


initCurrentLoader();


}
}

That code is from a demo I made many years ago that uses LoaderMax to load 4 swf files and play them in sequence. When a swf reaches it's last frame it tells the next swf to play. 

I have attached those files so that you can see this in action.

 

 

 

 

 

loadSWFsPlaySequence.zip

  • Like 1
Link to post
Share on other sites

I Want To Kiss You On Both Cheeks Bro ...  :-P  :-P  :-P  :-P  :-P  :-P  :-P  :-P  :-P

Solved ...

Link to post
Share on other sites

  :-o

 

that's a first :)

 

Glad it helped.

Link to post
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.

×