|
-
multiple video - CS3
G'day everyone, it's been few weeks since I started working with 3.0 now and that's a lot of changes from the little I knew about 2.0. I'm kind of in trouble with videos and I could surely use some help.
I'd like to have a video player in the middle of my webpage and clickable pictures of videos on both sides that would load the video its related to in the central player... well like youtube and similar video website.
I've been through the tutorials for 3.0 i got but it didn't lead me anywhere yet, so if I could get some guidances on how to do it, or a bit of code to start working with, I might figured it out and find my way, thanks in advance.
Cheers!
-
Our Flash Guru, Stefan Richter, just answered this question at Web Video Universe. Click here to see the response.
-
Thanx for the tips tdreier!
 Originally Posted by Stefan Richter at Web Video Universe
There are two ways to achieve what you want. The first is to place the video player and the images inside one large Flash movie. Basically, the images would be part of the Flash file that holds the player. The images would act like buttons: click an image and ActionScript attached to each image would play the corresponding video.
You could also put the images inside an HTML page with a Flash player in the middle. This method is a little more involved and calls for JavaScript. Flash can talk to JavaScript and JavaScript can talk to Flash, but you'll need to learn the ExternalInterface class in ActionScript to pull it off. This allows Flash functions to pass to JavaScript and JavaScript functions to pass to Flash. In your example, the image from the video could call a JavaScript function, which would in turn tell Flash to play the correct video. The ExternalInterface documentation should contain sample JavaScript code for you to start with and show you how to pass values back and forth.
Ok, thanks for the help Stefan, appreciated. I'm only working with Flash though, the website is one single flash element, no JavaScript. So the first part would be an accurate description of my demand... but unfortunately contains no exploitable answer on how to reach it.
 Originally Posted by Stefan Richter at Web Video Universe
The images would act like buttons: click an image and ActionScript attached to each image would play the corresponding video.
Precisely.
Anybody? Can someone throw me the right code to trigger the load of a video in player? That would be really handy and something to start with... Thanks a lot in advance.
Last edited by mata hari; 07-04-2008 at 07:55 AM.
-
you could try something like:
Code:
function clicker(evt:MouseEvent):void {
videoSWF.myFLV.pause();
videoSWF.myFLV.source = "newVidAsPerButtonClicked.flv";
videoSWF.myFLV.play();
}
theButton.addEventListener(MouseEvent.CLICK, clicker);
this assumes your FLV component is located in a movie clip called videoSWF. you'll need to do a bit more than this! but that's the basic code to make the buttons work, and switch FLV sources. I think.
Dan
-
Thanx for your help dan_hin, appreciated, though I finally found a way with the coding part, here's what i did and placed the vids on different point of the time line:
Code:
this.btn_video1.addEventListener(MouseEvent.CLICK,clickListener1);
function clickListener1(event:MouseEvent):void {
gotoAndPlay("_video1");
}
But unfortunately i ran into another trouble. So my coding's working now, all videos plays and stop when they're suppose to be, everything's working just fine. Except that once the site is online, the Player is not able to load and play any videos. Since it works fine on my computer but not online i guess this is a video location target problem... but i've tried for hours to modify the path location parameters without success yet.
So i'm lost again for a last errands i hope. Instead of locating all the videos on the time line as I did, i'll try your code to trigger the vids. But if anybody ran into similar problem, i'm taking any advice or tips that'll come. Thanx for your help.
cheers!
-
quick question - did you upload the videos and swfs and associated skins (if you used any, of course) in the same folder system you used when you were authoring?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|