AS2 audio file control

Hi, I use this code to start plaing my file.
I took it from one site but cannot understand:


if I trace it, I've got "undefined".
What should I use to create "progressBar". This is just a clip or some function.

I want to show how much is downloaded from mp.3 file when it's being played. I thought progressBar must be some clip...

Could you help me?

function loadStream(fileName) { 
  mp3 = new Sound(); 
  mp3.loadSound(fileName, true);
  stream = true; 
  abcdef = "Loading";
  progress_mp3 (mp3);

progressBar._visible = false; 

function progress_mp3(loadingTarget) { 
  progressBar._visible = true; 
  this.onEnterFrame = function() {
	if ((progressBar.getPercentComplete() == 100) 
      && (playing == false)) {
      this.onEnterFrame = undefined;
      playing = true;
      progressBar._visible = false;
      if (abcdef == "Loading") {
        abcdef = "Playing";

bt.onRelease = function() {

Open in new window

Who is Participating?
blue-genieConnect With a Mentor Commented:
um as far as i remember there is one. I only have CS3 and CS4 on my machine.
you can do it in AS2. otherwise track down that component

a simple google search has just verified that the component does exist in earlier flash IDEs

here's  a tutorial
a quick google search reveals that setLoadTarget refers to a component called  FprogressBar.
so wherever you got the code from there is probably a reference to where to get that component.

alternatively just refer to the help file and use the standard Flash progress bar component.
Master-SquirrelAuthor Commented:
Am I correct no way to do it in AS 2. I mean no embedded progressBar component is in AS 2?
Master-SquirrelAuthor Commented:
Thanks a lot.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.