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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

making rollover button that launches new project 1

Status
Not open for further replies.

andypilot

Technical User
Oct 8, 2001
18
0
0
I am in need of creating a Director project that has sub Director projects within. What I'd like to do is have a rollover button that, when pressed, does two things. Number one, fades the volume of the main audio track playing on the main project to zero, then launches the sub project called for by that particular button.

After that sub project plays, I'd like to return to the main project automatically, and it can even be from sprite number 1.

I'm assuming this is possible, but have no idea on how to make it work. any sugguestions?
 
Put this on the your button behavoir:

on mouseDown
sound(x).fadeOut (y000)
go to frame Z
end

X being the channel that your sound is playing in.
Y being the number of seconds that you want your sound to fade out in, so 5 seconds is expressed as 5000 in the parentheses, because it needs to be expressed in milliseconds.
and frame z is another frame, it could the next frame or any other frame in the movie, but this frame needs to everything that your other frame has. It certainly needs the sound sprite (if you put the sound in either sound channel 1 or 2).

On frame Z, you should have a frame script that looks like this
on enterFrame
delay Y* 60
end

on exitFrame
play movie "submovie"
end

This is will delay the movie for Y number of seconds (the same time you put in the fadeOut action) and then play your submovie.This second frame Z is needed to match the fadeOut time, it would just as easy to put:
on mouseDown
sound(x).fadeOut (y000)
play movie "submovie"
end

but then the fadeOut would be blocked out by the playing of the next movie. Frame Z is probably the easiest solution around that problem

at the endframe of your submovie just use on the frame script:

on exitFrame
play movie "mainmovie"
end

Hope this helps

 
archerofloaf,

Thanks! This is just about perfect! It works great! The only thing that I've noticed is that I really should have the returns come to frame 1440, instead of 1 of the main movie. How can I have it jump there, instead of back to the first frame?

Thanks a million!!!
 
That is not possible with the current configuration and scripts that you are using. I thought that might be a problem. I have not figured out the problem myself. But there is a way to get around it by using Movies in a Window or MIAW as they are known.

Instead of play movie "submovie", use:
open window "submovie"

This will open a another director movie over the mainmovie. The MIAW references the other .dir file. So it will play until the end , and on the last frame of the submovie .dir put a script like this:

on enterFrame
tell the stage to go to frame 1440
end

This passes the command from the MIAW to the mainmovie to go to frame 1400.

on exitFrame
window "submovie".close ()
end

This closes the window.

The problem with this way is that the window appears over the main director movie playing. But if you go into Director help you can learn other scripts to help you customize the look of the window. For instance, there are different windowTypes (some you can move, some you can't), and you can center the MIAW over the mainmovie.

Hope this helps you with the problem.
 
archerofloaf,

Thanks!

What I've done is create another "movie" that starts where I want the other submovies to join. Invisible to the end user, and it works!

Thanks for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top