• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 395
  • Last Modified:

Propagating mouse clicks through an object

I'm using an audio player that was implemented with Flash. It displays the selections available and when you click one it begins playing.  I would now also like to show the words for the song when it plays.  But since I don't have access to the Flash code I can't intercept the mouse click and have it display the words.  If I put another object over the player, where I can detect mouse clicks, I block the mouse clicks from being seen by the player and the player doesn't respond by playing the song.  

Does anyone see a way to display the song words when I click the song in the player?

Thanks for any ideas.
Steve
0
steva
Asked:
steva
  • 8
  • 6
1 Solution
 
dgofmanCommented:
Steve, is that possible to share your existing code. I will prefer to get FLA file for reproducing your problem
0
 
stevaAuthor Commented:
You can see the page at  http://www.upayahouse.com/music/Poets/poets.php .  Since the player is from a third party I don't have the FLA. And anyway, I want the words to appear in a different part of the page than the player.  It seems that what I need is a way to propagate the "click" event to other objects in the DOM, as well as to the player..  
0
 
dgofmanCommented:
What words do you want to display when is playing?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
stevaAuthor Commented:
I want to display the words to the song that is currently playing. And I would like them to appear in the area below the player.
0
 
dgofmanCommented:
so, you want to display the subtitles (words of the song) how you will synchronize with a music?
0
 
stevaAuthor Commented:
I just want all the words of the song to be visible while that song is playing.  So if you select the first song in the player it begins playing and a box appears that contains all of the lyrics to that song.
0
 
dgofmanCommented:
if you will set flashvar variable to autoLoad=false (instead true) you will able to get events to JavaScript functions

Add these functions

function onMediaStart(){
            alert("onMediaStart");
      }

      function onMediaStop(){
            alert("onMediaStop");
      }
      
      function onMediaPause(){
            alert("onMediaPause");
      }

and modify flashvars to

fontSize=large&strokeColor=000000&playlistXmlPath=playlist.xml&autoPlayNext=false&autoLoad=false
0
 
stevaAuthor Commented:
dgofman,

Thanks.  What you wrote looks interesting.  But instead of "onMediaStart()" I think I need something like "onTrack1Sart()", "onTrack2Start()".   If you look at the page again since I added some things - http://www.upayahouse.com/music/Poets/poets.php - you can see the effect I'm after.  But instead of clicking the external box to the right of the selection I'd like to be able to have the words appear when the song is selected in the player.
0
 
dgofmanCommented:
That player doesn't such function call onTrack1Sart, onTrack2Start :)
I gave you API of the player how you can track when song starts
0
 
stevaAuthor Commented:
So it looks like I need to go a different route, or maybe stay with what I have so far.

Just curious, how did you determine what functions were available in the PremiumBeat player?
0
 
dgofmanCommented:
You have three options
1) wait if someone give you better example
2) modify playlist.xml to some servlet what will registered on the backend the last user request to the file (for example using Java servlet) and when you will get JavaScript call make a request to the server using AJAX to get user selected file name
3) Accept my answer #36813086, because I gave you an answer how to "Propagating mouse clicks through an object" (intercept) and open a new thread "How to determinate selected song name?
And in this thread I will give you another solution how you can listen dispatch events from your player without using JavaScript and any servlets. It takes for me to go to different direction what I implemented now. That reason why I would like to split this question.
0
 
stevaAuthor Commented:
Your 36813086 response did not answer my question.  It described a way  to sense when the media starts, stops, or pauses,  but this is not the same as propagating through the mouse click, with all of its parameters, including its x and y values, which I need to determine the actual selection.  

If you describe a way to determine which song was clicked I'll be glad to give you the points.

 
0
 
stevaAuthor Commented:
I have solved this myself.  I purchased the Longtail JW player which has excellent documentation and excellent support. With this player  I was able to receive and process the end-of-track events and synchronize the music to the words.
0
 
stevaAuthor Commented:
Sorry for not giving out the points but I had to eventually solve this myself.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 8
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now