I’ve googled and googled but got no where or outdated tutorials. Anyone know how to make it so I can toggle audio with buttons using ActionScript 3 on Flash?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To toggle play/pause you will need to record the position of where the user has paused the audio.
To use a sound from the library like in your screenshot, you need to make that sound file available to your Actionscript.
First, Right click the sound file in your Library and click on
Properties.... Inside the Properties window, check the box toExport for Actionscript. Change the Class name to something of your own, likeMySong.Now inside your code instead of pointing to an external Sound file, you will make
mySoundan instance ofMySong.To use an external file
You would need to use the URLRequest class to point to where the mp3 file is located. If the file was in the same directory as your published swf file it would look like this.