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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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?
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Master-SquirrelAuthor Commented:
Thanks a lot.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.