Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JavaScript to Flash MP3 Player - Please Help!!!

Status
Not open for further replies.

VicD

Programmer
Nov 10, 2003
1
US
built a very simple Flash MP3 player.

If I specify the sound file from within the SWF, everything works fine. For example, in frame 1:



<<
MyMusic = new Sound();
MyMusic.loadSound(&quot;BTTV.mp3&quot;,true);
>>



But this is fairly useless to me, since I have hundreds of MP3 files, and I want to use the same flash player to play any/all of them.

I want to be able to control the file that loads in the SWF via JavaScript.

How Can I Do It!!!???!!!??

I have tried:

1.



<<
window.document.MP3_Player.MyMusic = new Sound();
window.document.MP3_Player.myMusic.loadSound(&quot;BTTV.mp3&quot;,true);
>>



2.

(In an body.onLoad function in the HTML/JavaScript):



<<
window.docuemnt.MP3_Player.SetVariable( &quot;MY_FILE&quot;, &quot;BTTV.mp3&quot; );
window.docuemnt.MP3_Player.gotoAndStop(2);
>>



(In the 2nd frame of the SWF):


<<
MyMusic = new Sound();
MyMusic.loadSound(MY_FILE, true);
>>



Nothing has worked!

I am developing on a Mac. Netscape get's JavaScript errors saying that even SetVariable is not a function. I have checked and the plug in is not locked! PLEASE HELP!!!




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top