Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get the movie pages 1

Status
Not open for further replies.

Keendev

Technical User
Jan 23, 2006
106
PH
Need help on this...

I have a main movie (main.fla), and inside of it is
the navigation, button for About,Contact page and other pages.

And each page has different external .fla or swf (contact.swf,about.swf etc.), and loads on the movie(page) when the button is clicked.


for example page is on Contact, then I click "About" button, I need to fade-out Contact page and fade-in About.swf at the same time. Same thing w/ other pages.

How do I get the previous page?

need help.







 
Make sure that your start movie has an instance name.
You could use a nice onEnterFrame.

Create a function (ie function new_movie_loading())
In the function load the required movie and make sure to give it an instance name.

Give it an Alpha of 0.

onEnterFrame = function()
==>
Check if it has loaded fully.
If it has loaded fully build another if statement.
This one checks on the Alpha
if(About._alpha<100)
{
About._alpha += 10;
Contact._alpha -10;
}
else
{
delete onEnterFrame;
}

Ok, this is not very dynamic. So if this is working for the transition from the Contact page to the About page start replacing 'About._alpha' and 'Contact._alpha' with 2 variables. One being current_movie and the other new_movie.

Then set the onclick action of your buttons to call this function you created and pass the movie name you need to load 'new_movie_loading(about.swf)' (dont forget to adjust the function itself to read 'function new_movie_loading(new_movie)'.

Now do all the stuff as before.
And once alpha of the new_movie >= 100 then set the current_movie variable to be the new_movie variable.

Don't forget that this won't work if you don't specify a 'current_movie' variable at the start of your project... I think that otherwise it may throw up some errors that current_movie._alpha is undefined or what ever.

Hope this helps to get you in the right direction.
Please feel free to put your fla somewhere for me to have a look at.


JR (IT = Logic (except for a well known OS where it equals luck) -> Back to the Basics!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top