Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Please Help with small Action Script Codes

New Here ,
Jun 19, 2007 Jun 19, 2007
Hi,

I'm using CS3, action script 3.0. I have 6 buttons, each one that when clicked on will play a particular video. I've linked each button to the right video, but i can't work out how to make the videos invisible before you click the button. It must be simple, but i can't work it out!

Second thing is that each button, when clicked, should also stop any other of the 6 videos that is already playing. What is the action script for that? Can't work it out either.

Either the actual code, or where to go when using Script assist would be really appreciated!

Thank you
TOPICS
ActionScript
197
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 19, 2007 Jun 19, 2007
You should be able to toggle the _visible attribute of each video on click and when it's loaded. You'll have to track the active video target name in a variable so you know which one to stop and make invisible when you click on the next one to play.

An easier way to do this would be to have a single flash video movie object that you change the movie path on when you click each of your buttons. That way you're not loading all the videos all at once and you don't have to worry about hiding and showing them. It's as simple as coding:

[videoComponentName].stop;
[videoComponentName].contentPath = [relative path of the flv you want to play next]
[videoComponentName].play;

good luck!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 20, 2007 Jun 20, 2007
LATEST
Thank you for your reply...though i'm afraid my knowledge of flash is not that great and not everything you've said made sense.

"An easier way to do this would be to have a single flash video movie object that you change the movie path on when you click each of your buttons. That way you're not loading all the videos all at once and you don't have to worry about hiding and showing them."

So what you're saying i have one long flv that plays but each button can skip to a different part of the video?

"[videoComponentName].stop;
[videoComponentName].contentPath = [relative path of the flv you want to play next]
[videoComponentName].play;"

What do you mean by "relative path of the flv"? Do you mean the exact frame it should go to?

Thanks again for your help.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines