Join Todd Perkins for an in-depth discussion in this video Showing progress in a text field, part of Flash CS4 Professional Audio Techniques.
In this movie, we will look at showing the progress of the playing sound.…Both in the progress bar and in the text field.…Scroll down to the init method.…In the init method we are going to add an event listener to the player, so type…player.addEventListener and for the event listener it will be Event.ENTER_FRAME,…make sure that's all caps.…And we will run a method called showPlayProgress.…Play should have a capital P as well as progress.…
Just copy this code and then paste it inside of the disable method and just…change addEventListener to removeEventListener.…Below disable, define a private method called showPlayProgress.…Make sure to make it receive an event with a datatype of Event, now return data…and write some curly braces.…The first thing you want to do is create an if statement.…So, create the skeleton of an if statement, make some curly braces, and inside…of the if statement we are going to see if player.channel exists or if there…is a sound channel.…
And if player.sound.length != 0.…So, we want to make sure that some of the sound at least is downloaded before…
- Playing and pausing audio in a created player class
- Controlling audio progress and showing it in a text field
- Loading XML playlist data into the final player
- Animating a volume slider and using effects to add depth
- Making Flash applications sharable
- Viewing the finished player and taking it for a spin
Skill Level Intermediate
Q: I am having trouble getting the exercise files to work for this title. For example, when I drag the progress bar of a song to another location on the slider, the movieclip always jumps back to the beginning and the song starts over. What could be causing this error?
A: An update to Flash since the time of recording broke this functionality. The problem appears to happen when Flash compiles the SWF in Flash Player 10. If you change your publish settings to Flash Player 9 instead, you won't see any problems.