In this video tutorial, Creative Cow leader Tony Ross demonstrates how to create a simple multi-video player in Flash using Actionscript 2. Also learn to have several videos use a single flv player.
Tutorial, Video Tutorial 02/05/2009 Author:Tony Ross
Re: New Flash Tutorial - Simple Multi-Video Player in AS2 by Adam Figueira on Feb 8, 2009 at 4:14:47 am
Tony,
Great tutorial. I think I followed your steps, but for some reason all my video files are playing simultaneously. I can only see one of them, but I can hear all of them. Do you have any idea what I did wrong?
Re: New Flash Tutorial - Simple Multi-Video Player in AS2 by Tony Ross on Feb 9, 2009 at 4:39:11 pm
Hey Adam-
Perhaps you imported all 3 flvs? If so, you only need to import 1, the buttons call the others from the folder via actionscript. If you are still having issues, post the actionscript you have.
Re: New Flash Tutorial - Simple Multi-Video Player in AS2 by Tony Ross on Feb 10, 2009 at 12:45:04 pm
OK, This looks good. So, the next question is, "is the fla you are working on in the same directory/folder as the flvs? According to your script, it has to be.
Is everything named correctly so instance names match your script?
Re: New Flash Tutorial - Simple Multi-Video Player in AS2 by Rune Pedersen on Feb 11, 2009 at 3:22:36 pm
Hi Tony.
Maybe this is the correct thread, maybe not, but here goes.!
It has been about 6 years since I've worked with Flash, and now I'm tryin' to keep up. My problem is somewhat similar to what Adam described. I have only one .flv file playing on my site, and it plays fine. But when I navigate further on, the .flv file doesn't stop playing. I can still hear the audio rambling on in the background. And when I click back to the page where the .flvplayer is, it begins playing on top of the already playing .flv-file.
And my actionscript looks like this:
Home_B.addEventListener(MouseEvent.CLICK, link1);
Demo_B.addEventListener(MouseEvent.CLICK, link2);
Koncept_B.addEventListener(MouseEvent.CLICK, link3);
Benefit_B.addEventListener(MouseEvent.CLICK, link4);
About_B.addEventListener(MouseEvent.CLICK, link5);
function link1(e:MouseEvent):void {
gotoAndStop(1);
}
function link2(e:MouseEvent):void {
gotoAndStop(5);
}
function link3(e:MouseEvent):void {
gotoAndStop(10);
}
function link4(e:MouseEvent):void {
gotoAndStop(15);
}
function link5(e:MouseEvent):void {
gotoAndStop(20);
}
My simple guess is that I need to assign an action to my buttons, telling them to stop the .flv file on release, or something like that. But as I wrote earlier. My Flash-skills are pretty outdated. ;-)
I hope you're able to help me with this, or guide me further on.!
Re: New Flash Tutorial - Simple Multi-Video Player in AS2 by Tony Ross on Feb 13, 2009 at 12:25:41 am
Adam
I found the problem. Everything is named correctly, your buttons however are built incorrectly. You had buttons placed inside of your buttons. I made a quick Jing to show you the correction:
http://www.tonyteach.com/jing/adam_video.swf
Re: New Flash Tutorial - Simple Multi-Video Player in AS2 by Michael Belanger on Feb 13, 2009 at 4:20:34 pm
Yes this tutorial is quite good indeed especially for newbies and those of us in AS2 for now.
I will throw you this one tough (maybe) question. I have a flash page where I have four buttons representing 4 demo videos. They are buttons with instances and I need to have each play the correct video HOWEVER I would prefer to have the videos come into frame kinda like flowplayer...dissolve on and start playing but with some controls. Can I do this with 4 separate SWF files each having controls and then make each button trigger those swfs to play OR is there some more sophisticated way to do this? I need to do this in AS 2 . I guess the point is that I don't want to have a box area where the videos play like your tutorial. Any suggestions with script would be great.
Mike B
Dandelion Picture&Sound
Toronto Canada
www.dandelionediting.com
but you have the flv called anything other than "01.flv" that would be a problem.
Keep your flv names simple (I would go with one word), and make sure the button is calling for that name. Does that make sense?
Re: New Flash Tutorial - Simple Multi-Video Player in AS2 by Terry Brown on Mar 11, 2009 at 3:11:42 pm
Seems I can get the first flv to load if I give it a URL on video import (http://domain/FLAS/flv) but the other flvs won't load when using the buttons.
UPDATE: I managed to get it to work on my computer but mot from the server.