addEventListener(MouseEvent.CLICK, not working

addEventListener(MouseEvent.CLICK, not working

Page 1 of 1

2 Replies - 15071 Views - Last Post: 26 January 2010 - 11:19 AM

#1 mcse_696  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 18-December 09

addEventListener(MouseEvent.CLICK, not working

Post icon  Posted 16 January 2010 - 06:15 AM

hi all

I m working on custum video player, here is the link I did exactly same steps except I added my videos http://www.photoshop...videoPlayer.htm

btn1.addEventListener(MouseEvent.CLICK, vid1);
btn2.addEventListener(MouseEvent.CLICK, vid2);
btn3.addEventListener(MouseEvent.CLICK, vid3);
function vid1(e:Event):void{
vidPlayer.source = "video1.flv"
};
function vid2(e:Event):void{
vidPlayer.source = "video2.flv"
};

function vid3(e:Event):void{
vidPlayer.source = "video3.flv"
};

when I click on buttons no action whats wrong ???

Is This A Good Question/Topic? 0
  • +

Replies To: addEventListener(MouseEvent.CLICK, not working

#2 DigitalMonk  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 16-June 09

Re: addEventListener(MouseEvent.CLICK, not working

Posted 26 January 2010 - 09:39 AM

View Postmcse_696, on 16 Jan, 2010 - 05:15 AM, said:

hi all

I m working on custum video player, here is the link I did exactly same steps except I added my videos http://www.photoshop...videoPlayer.htm

btn1.addEventListener(MouseEvent.CLICK, vid1);
btn2.addEventListener(MouseEvent.CLICK, vid2);
btn3.addEventListener(MouseEvent.CLICK, vid3);
function vid1(e:Event):void{
vidPlayer.source = "video1.flv"
};
function vid2(e:Event):void{
vidPlayer.source = "video2.flv"
};

function vid3(e:Event):void{
vidPlayer.source = "video3.flv"
};

when I click on buttons no action whats wrong ???



Looks like you're setting the source for the video player, but you're not actually telling the video player to start playing.
Was This Post Helpful? 0
  • +
  • -

#3 SoLi  Icon User is offline

  • andydust.com

Reputation: 41
  • View blog
  • Posts: 1,438
  • Joined: 27-January 02

Re: addEventListener(MouseEvent.CLICK, not working

Posted 26 January 2010 - 11:19 AM

Quote

Looks like you're setting the source for the video player, but you're not actually telling the video player to start playing.


When using the FLVPlayback component, as long as the autoPlay property isn't set to false (it's true by default) the movie should begin playing once the source property is set.

In order to check that your functions are being run, do some simple debugging by adding a trace to them:

e.g.:

function vid1(e:Event):void{
trace("btn1 clicked!");
vidPlayer.source = "video1.flv"
};



The trace output can be found on the output panel when testing your SWF in the flash IDE or in a log file (location depends on system) if you are testing through the debug version of the flash web browser plugin.

What's more likely is that your FLV files cannot be found by the FLVPlayback component. Remember, local paths are relative to the location of your SWF. So from what I can gather from your above code, the FLV files must be located in the same folder as the SWF.

This post has been edited by SoLi: 26 January 2010 - 11:20 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1