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

  • SEARCH
  • Home
  • 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 3676496
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:06:20+00:00 2026-05-19T03:06:20+00:00

Inn the below code i have placed my mp3 in the src directory where

  • 0

Inn the below code i have placed my mp3 in the src directory where this mxml file resides.So when the swf is loaded i can see the button i am not able to get the mp3 playing is that something to do do with the path

  <?xml version="1.0" encoding="utf-8"?>
   <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
           xmlns:s="library://ns.adobe.com/flex/spark" 
           xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Script>
    <![CDATA[
        import flash.display.Sprite;
        import flash.display.InteractiveObject;
        import flash.display.Sprite;
        import flash.media.*;
        import flash.net.*;
        import mx.controls.Alert;
        import mx.controls.Button;
        import flash.events.Event;
        import flash.media.Sound;
        import flash.net.URLRequest;



        private function clickhandler(event:Event):void
        {
            var s:Sound = new Sound();
            s.addEventListener(Event.COMPLETE, onSoundLoaded);
            var req:URLRequest = new URLRequest("sound.mp3");   
            s.load(req);

        }

        private function onSoundLoaded(event:Event):void
        {
            var localSound:Sound = event.target as Sound;
            localSound.play();
        }

    ]]>
</fx:Script>
<fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<mx:Button id="play" label="PLAY" click="clickhandler(event)"  />

</s:Application>
  • 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-05-19T03:06:21+00:00Added an answer on May 19, 2026 at 3:06 am

    In the line:

    var req:URLRequest = new URLRequest("sound.mp3");
    

    you need to specify the full URL to the sound.mp3. Something like

    var req:URLRequest = new URLRequest("http://server.name.com/path/to/sound.mp3");
    

    If you don’t want to compile the path into your application, you can use the Application.url property, which gives you the URL from which your application was loaded. If you know where your mp3 lives relative to that, you can modify the path appropriately and load from there.

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

Sidebar

Related Questions

Below is the code snippet with comments which describes the problem statement. We have
I have the following code: employees = Employee.query() employees = employees.filter(query.OR(Employee.passport_id == passport_id, Employee.inn
How do I exit from the recursive loop from the code below. I would
I have an HTML form that sends 索索索 using post to my PHP file.
Can anyone explain why the third insert (labeled Query Data ) in the below
Do any have any experience how this cold be done, if you look at
Below is the code: <script type="text/javascript"> function sortNumber(a,b) { return a - b; }
Inn ~/script.vim , I have: set runtimepath+=string(substitute(expand(%:p), 'script\.vim', '', 'g')) I have an alias
I have a kind of assertion error in this program, and unfortunately I'm quite
I am new to creating stored procedures and I saw this sql below in

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.