Link to home
Create AccountLog in
Avatar of ForLoop5
ForLoop5Flag for United States of America

asked on

How can I make this script play a file in my library?

I have this script and it plays a sound from my server.  I would like it o play a sound from my library instead.  I set the linkage on the the sound and then I modified the url request part to play the file in the library by the linkage name but I kept getting errors.  Can you show me how to play a file from the library instead.  
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

The error is probably "Access Denied"??  Scripts on web pages are not normally allowed to access files on your computer.
you should download some flash tutorials which has audio in them it should be simple if its not playing in your browser sometime security settings prevent that
Avatar of jediborre
jediborre

If its in AS2 should not be the problem in AS3  maybe the code is wrong
Avatar of ForLoop5

ASKER

the file si snot on my local computer.  It is in the library of the flash file.  I forgot to put the code in the question

playbutton6.addEventListener(MouseEvent.CLICK,player6);

             function player6(event:MouseEvent){
                  // Wave clip
                  
                  
                  
                  // Load sample MP3...
                  mp3Samples = new ByteArray();
                  mp3Sample = new Sound(new URLRequest("http://www.buttonbeats.com/hbeat/1.mp3"));
                  mp3Sample.addEventListener(Event.COMPLETE, loadHandler);
                  
                  // Update screen every frame
                  addEventListener(Event.ENTER_FRAME,enterFrameHandler);
            }      

Can you help me change this to play a file from my library with the linkage name of "soud55"
ASKER CERTIFIED SOLUTION
Avatar of blue-genie
blue-genie
Flag of South Africa image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account