PDA

View Full Version : Must I do code for every movie?!


xtreme
03-21-2004, 01:27 PM
I have 10 movies over eachother och 10 buttons to start and stop them. Do I need this code under every button or can I do it smarter?

ON CLICK
Video.SetVisible("Video1", false);
Video.Stop("Video1");
Video.SetVisible("Video2", false);
Video.Stop("Video2");
Video.SetVisible("Video3", false);
Video.Stop("Video3");
Video.SetVisible("Video7", false);
Video.Stop("Video7");
Video.SetVisible("Video5", false);
Video.Stop("Video5");
Video.SetVisible("Video6", false);
Video.Stop("Video6");
Video.SetVisible("Video8", false);
Video.Stop("Video8");
Video.SetVisible("Video9", false);
Video.Stop("Video9");
Video.SetVisible("Video10", false);
Video.Stop("Video10");

Video.SetVisible("Video4", true);
Video.Play("Video4");

xtreme
03-21-2004, 02:09 PM
Work very well! Thanks!


Originally posted by Pip-Boy
You could instead have just one video object. That way you could use:

Video.Load("Video1", "Autoplay\\Videos\\MyMovieName.avi", true, false);

substituting the "MyMovieName.avi" part with the name of the movie file you want to load on each button. This would load the movie you need into the "Video1" object so you only need to place one on the screen instead of 10 and setting the visibility on each button.

The 'true' parameter would make the video start playing immediately, skipping the need for Video.Play also.

If your videos are different sizes, you can use

Video.SetSize("Video1", MyMovieWidth, MyMovieHeight);

on each button as well to set the size of the "Video1" object so your movies don't distort in size.

Corey
03-21-2004, 02:17 PM
Hi. I notice you are posting and replying to your very own questions using multiple user names from the exact same IP again. Not sure why you keep doing that but I would just like to politely request that you refrain. Thanks.

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)