Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8895837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:53:24+00:00 2026-06-14T23:53:24+00:00

I am using the code below to load an external mp3 file: //Create an

  • 0

I am using the code below to load an external mp3 file:

//Create an instance of the Sound class
var soundClip:Sound=new Sound();

//Create a new SoundChannel Object
var sndChannel:SoundChannel=new SoundChannel();

//Load sound using URLRequest
soundClip.load(new URLRequest("namesounds/agamemnonas.mp3"));

//Create an event listener that wll update once sound has finished loading
soundClip.addEventListener(Event.COMPLETE,onComplete,false,0,true);
function onComplete(evt:Event):void {
    //Play loaded sound
    sndChannel=soundClip.play();
}

Also in my html I have a drop down list:

<select name="sounds" id="sounds">
  <option value="sounds/eden.mp3" selected="selected">eden</option>
  <option value="sounds/zeus.mp3">zeus</option>
  <option value="sounds/earth.mp3">earth</option>
</select>

Is it possible to send a path from a drop down menu to a flash file?
For example:

//Load sound using URLRequest
soundClip.load(new URLRequest("namesounds/agamemnonas.mp3"));

The URLRequest must be the path from drop down menu list from my .php file.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T23:53:26+00:00Added an answer on June 14, 2026 at 11:53 pm

    You’ll have to use ExternalInterface.addCallback in your AS and call that function from javascript

    AS3

    ExternalInterface.addCallback("loadSoundClip", loadSoundClip);
    function loadSoundClip(mp3File:String):void{
        soundClip.load(new URLRequest(mp3File));
    }
    

    Pure Javascript

    // This is the <select>
    var sounds = document.getElementById('sounds');
    // This is the <object>/<embed>
    var flashObject = document.getElementById('flashObject');
    sounds.onchange = function(){
        flashObject.loadSoundClip(sounds.options[sounds.selectedIndex].value);
    };
    

    OR

    jQuery

    // This is the <select>
    var sounds = $('#sounds');
    // This is the <object>/<embed>
    var flashObject = $('#flashObject');
    sounds.on('change', function(){
        flashObject[0].loadSoundClip($(this).val());
    });
    

    Don’t forget to set your allowscriptaccess of the object / embed to the correct value so the page can communicate with the flash object

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the below code in my test class , to load all
I am trying to load a JS file using yepnope using the below code:
I am using below code to load a xml: XmlDocument xdoc = new XmlDocument();
I'm using the code below to load a text file content into a WebView
Afternoon all, Using the code below I'm trying to load what is render by
Using the code below I can insert a new row to my table (
I am using the code below to get processor id: System.Management.ManagementClass theClass = new
I am able to create controls pro grammatically using the code below without issue:
I'm getting some very jerky scrolling while using the code below to create a
I am using the code below for loading an external page into a lightbox.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.