I want to display the lyrics while playing a song on the screen. Actual number of the lyrics should be dsiplayed on the screen are 3. and pass those lyrics line by line based on the time of song. Here I have to animate the current playing text word by word. How to get the current word in current line in current time? (I divided and noted start time and end time of each word in xml file.)
I can think you can create a timer object class and use it as a timer, add an event every time the timer value change, to look if that value is for any child of the xml, if the condition match displays the word. Maybe this could consume many system resources, but can be done.
Thank you so much for the reply.....
I have got the solution for line by line passing but now I want word to word passing of lyrics when song is playing. I tried in many ways but no use. I want ouput as in the following website when we play a song.
Please go through the below website:
When we play a song, it is starting playing in video player which is on the top right. Lyrics should be displayed like that.
You need to create a motion tween that slides the text field on in. Once you create the tween, copy the motion tween code and put it in a function that you call when you play the lyrics. That appears to be the jist of what you probably need to do. If you want more detailed instructions check out http://edutechwiki.unige.ch/en/Flash_CS4_motion_tweening_with_AS3_tuto rial#Using_Copy_Motion_as_AS3
Hmmm. Couldn't you create a timer that posts the words when they are supposed to appear. It would work by subtracting from the total amount of time of the song, so let's say we have a three minute song. We would express that as 30,000 milliseconds in the timer. So var yourtimer = new Timer(30,000,180); // 30,000 is three minutes and 180 is three minutes of loop. Trying to avoid an infinite loop.
Then you could bring in the new words with another variable, let's call it wordtime. You could set wordtime to any amount you want, but let's say there is a new word every second. You could put var wordtime:uint = 180; . Then once a new word appears on the screen you could go wordtime--; once wordtime is if(wordtime <= 0) trace("the song is over"); I am assuming you are pulling the words in via a server... am I right? I'll need to know a little more about your process on how you are pulling the words in to help you out.
please note that you only need brackets for an if statement if you use more than one line of code. That isn't counting minified code. just one line like I did above with the trace.
Thank you so much for your reply and sorry for the late response.
I just pull word by word from the server and each word having its time for the play. I took a song for the example which is about 230000 milli seconds loop. I want to display the song line by line and pass those words while playing the song according to the time given to each word.
Please go through the below website:
And play a song. I exactly want that output which is displayed in player at the top right.
This is how it would work, you want x amount of words to appear on the screen. You grab all the words from the server and put them into an array. if you want six words to appear and the array has emptied 6 slots then remove those words from the screen and print out the next six words from the array. You would do this until the array is empty. I would reccommend using a for or while loop to do this. I am to tired to write out the code or even psuedo code. I hope this might be somewhat helpful.
Here is a tutorial on exactly what you are trying to accomplish! Please note you are reading from cache and not the actual webpage. The actual webpage either removed this article or changed the URL without a redirect. http://webcache.googleusercontent.com/search?q=cache:W8Ue0aFUb-EJ:www. toddperkins.com/2010/05/20/displaying-synced-song-lyrics-tutorial/+&cd =3&hl=en&ct=clnk&gl=us