Loading external sound doesn't work

I'm trying to load the external sound file
melo01melodrama.mp3 to play in my movie. In the help files it says
To test the examples in this chapter:
Create a new Flash document and save it on your computer.
In the Timeline, select the first keyframe and open the
Actions panel.
Copy the example code listing into the Script pane.
If the code involves loading an external sound file, it will
have a line of code that looks something like this:
var req:URLRequest = new URLRequest("click.mp3");
var s:Sound = new Sound(req);
where "click.mp3" is the name of the sound file being loaded.
In order to test these examples, you'll need to have an mp3 file to
use. You should put the mp3 file in the same folder as your Flash
document. You should then alter the code to use the name of your
mp3 file instead of the name in the code listing (for example, in
the code above you'd change "click.mp3" to the name of your mp3
file).
From the main menu, choose Control > Test Movie to create
the SWF file and preview (and hear) the output of the example.
Well, I created a new frame, opened the Actions panel and put
var req:URLRequest = new URLRequest("melo01melodrama.mp3");
var s:Sound = new Sound(req);
in the Script pane. However, if I try to test the movie,
nothing plays. The Flash movie is in the same folder as the mp.3
file, so it's not a path issue. How do I get this to work?

this should do the trick for you.
var req:URLRequest = new URLRequest("melo01melodrama.mp3");
var mySound:Sound = new Sound();
mySound.addEventListener(Event.COMPLETE, onComplete);
mySound.load(req);
function onComplete(event:Event):void{
trace(event);

Similar Messages

  • Mplyer sound doesn't work, instead amarok's sond work !!!

    hi everyone, the problem is that mplayer's sound doesn't work.
    the sound with Amarok and Firefox(e.g youtube) works, but with mpalyer no !!!
    i've posted some commands:
    thanks
    /etc/mplayer/
    codecs.conf   example.conf  input.conf
    /etc/mplayer/example.conf
    # MPlayer configuration file
    # Configuration files are read system-wide from /usr/local/etc/mplayer.conf
    # and per-user from ~/.mplayer/config, where per-user settings override
    # system-wide settings, all of which are overrriden by the command line.
    # The configuration file settings are the same as the command line
    # options without the preceding '-'.
    # See the CONFIGURATION FILES section in the man page
    # for a detailed description of the syntax.
    # Profiles should be placed at the bottom of the configuration file to ensure
    # that settings wanted as defaults are not restricted to specific profiles.
    # video settings #
    # Specify default video driver (see -vo help for a list).
    #vo=xv
    # Use SDL video with the aalib subdriver by default.
    #vo = sdl:aalib
    # FBdev driver:
    # mode to use (read from fb.modes)
    #fbmode = 640x480-120
    # location of the fb.modes file
    #fbmodeconfig = /etc/fb.modes
    # Specify your monitor timings for the vesa and fbdev video output drivers.
    # See /etc/X11/XF86Config for timings. Be careful; if you specify settings
    # that exceed the capabilities of your monitor, you may damage it.
    # horizontal frequency range (k stands for 1000)
    #monitor-hfreq = 31.5k-50k,70k
    # vertical frequency range
    #monitor-vfreq = 50-90
    # dotclock (or pixelclock) range (m stands for 1000000)
    #monitor-dotclock = 30M-300M
    # Start in fullscreen mode by default.
    #fs=yes
    # Change to a different videomode when going fullscreen.
    #vm=yes
    # Override the autodetected color depth, may need 'vm=yes' as well.
    #bpp=0
    # Enable software scaling (powerful CPU needed) for video output
    # drivers that do not support hardware scaling.
    #zoom=yes
    # standard monitor size, with square pixels
    #monitoraspect=4:3
    # Use this for a widescreen monitor, non-square pixels.
    #monitoraspect=16:9
    # Keep the player window on top of all other windows.
    #ontop=yes
    # audio settings #
    # Specify default audio driver (see -ao help for a list).
    #ao=oss
    # Use SDL audio driver with the esd subdriver by default.
    #ao = sdl:esd
    # Specify the mixer device.
    #mixer = /dev/mixer
    # Resample the sound to 44100Hz with the lavcresample audio filter.
    #af=lavcresample=44100
    # Output audio to S/PDIF
    #ao=alsa:device=spdif
    #ac=hwac3,hwdts,hwmpa,
    # other settings #
    # Pretend to be Window Media Player.
    # Fixes playback when playlist and media file use the same URL.
    #user-agent=NSPlayer/4.1.0.3856
    # Pretend to be Quicktime
    # Fixes playback for apple.com/trailers redirects
    #user-agent="QuickTime"
    # Pretend to be Realplayer SP
    # Fixes playback for some video streaming sites
    #user-agent=RMA/1.0
    # Pretend to have lots of bandwidth
    # Speeds up realmedia rtsp:// streams
    #bandwidth=2000000
    # Pretend to be Winamp
    # Fixes playback of some NSV streams
    #user-agent="Winamp NSV Player/5.12 (ultravox/2.0)"
    # Drop frames to preserve audio/video sync.
    #framedrop = yes
    # Specify your preferred skin here (skins are searched for in
    # /usr/local/share/mplayer/skins/<name> and ~/.mplayer/skins/<name>).
    #skin = Abyss
    # Resample the font alphamap.
    # 0 plain white fonts
    # 0.75 very narrow black outline (default)
    # 1 narrow black outline
    # 10 bold black outline
    #ffactor = 0.75
    # cache settings
    # Use 8MB input cache by default.
    #cache = 8192
    # Prefill 20% of the cache before starting playback.
    #cache-min = 20.0
    # Prefill 50% of the cache before restarting playback after the cache emptied.
    #cache-seek-min = 50
    # DVD: Display English subtitles if available.
    #slang = en
    # DVD: Play English audio tracks if available.
    #alang = en
    # Profiles #
    # The options declared as part of profiles override global default settings,
    # but only take effect when the profile is active.
    [protocol.dvdnav]
    #vc=ffmpeg12,
    #mouse-movements=yes
    #nocache=yes
    #[vo.vdpau]
    #vc=ffmpeg12vdpau,ffwmv3vdpau,ffvc1vdpau,ffh264vdpau,ffodivxvdpau,
    # Most video filters do not work with vdpau.
    #vf-clr=yes
    # OSD progress bar vertical alignment
    #progbar-align=50
    # You can also include other configuration files.
    #include = /path/to/the/file/you/want/to/include
    ~/.mplayer/config
    # Write your default config options here!
    # [default] viene applicata a ogni file
    [default]
    # usa il server grafico X come video output
    vo=xv
    # usa alsa per l'audio output
    ao=alsa
    # ao=oss # Use OSS4
    # decodifica multithreaded H264/MPEG-1/2 (valido: 1-8)
    lavdopts=threads=2
    # impostare il canale audio preferito (in questo esempio il numero sei)
    channels = 6
    # scala i sottotitoli al 3% della dimensione dello schermo
    subfont-text-scale = 3
    # non usa fontconfig
    nofontconfig = 1
    # aggiunge bordi neri ai filmati che non hanno lo stesso aspetto di forma dello schermo
    # per wide screen monitors
    vf-add=expand=::::1:16/9:16
    # per non wide screen traditional monitors
    #vf-add=expand=::::1:4/3:16
    #profilo di up-mixing da due canali audio a sei canali
    # use -profile 2chto6ch to activate
    [2chto6ch]
    af-add=pan=6:1:0:.4:0:.6:2:0:1:0:.4:.6:2
    #profilo di down-mixing da sei canali audio a due canali
    # use -profile 6chto2ch to activate
    [6chto2ch]
    af-add=pan=2:0.7:0:0:0.7:0.5:0:0:0.5:0.6:0.6:0:0
    # Disabilita screensaver
    heartbeat-cmd="xscreensaver-command -deactivate &" # stop xscreensaver
    stop-xscreensaver="yes" # stop gnome-screensaver
    ls /etc/modprobe.d/
    alsa-base.conf  snd-hda-intel.conf
    etc/modprobe.d/alsa-base.conf
    options snd slots=snd_mia,snd_hda_intel
    options snd_mia index=1
    options snd_hda_intel index=0
    /etc/modprobe.d/snd-hda-intel.conf
    options snd-hda-intel model=auto
    cat /proc/asound/modules
    0 snd_hda_intel
    lsmod |grep snd
    snd_hda_codec_hdmi 30162 1
    snd_hda_codec_conexant 36759 1
    snd_hda_intel 37000 2
    snd_hda_codec 150305 3 snd_hda_codec_hdmi,snd_hda_codec_conexant,snd_hda_intel
    snd_hwdep 6340 1 snd_hda_codec
    snd_pcm 77645 3 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel
    snd_page_alloc 7210 2 snd_pcm,snd_hda_intel
    snd_timer 18726 1 snd_pcm
    snd 59109 11 snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_hda_codec_conexant,snd_pcm,snd_hda_codec,snd_hda_intel
    soundcore 5450 1 snd

    Neburski wrote:
    ryanjacobs wrote:So, apparently, your system cannot find the ALSA output driver. I suggest that you use a different driver than ALSA.
    OP should first go through the wiki page of ALSA to ensure that his ALSA setup is working correctly. There aren't many sound setups that do not work under ALSA. If OP is relying on another sound setup then he should follow the appropriate wiki and tell us so.
    @otto88: It would also help if you would try to explain what your intentions were. I'm assuming you merely want to have sound working and not configure some fancy setup. In that case you should just stick to a basic setup and follow the wiki step by step (don't skip any line and if you don't understand something, you figure that out or you ask people, don't just ignore it).
    For instance I don't even have those /etc/modprobe.d/alsa-base.conf and /etc/modprobe.d/snd-hda-intel.conf even though I have 2 sound devices, while you seem to only have 1 sound device
    otto88 wrote:cat /proc/asound/modules
    0 snd_hda_intel
    So your /etc/modprobe.d/alsa-base.conf in that case is totally unnecessary, let alone that you don't even have the snd_mia module loaded so why do you even configure alsa to load it at index 1. You aren't supposed to simply copy and paste the configurations from the wiki. Those configurations are merely there to give you an idea on how to make your own configuration.
    When you have ensured that your sound is been set up correctly then you can start with the most basic mplayer configuration. You keep the /etc/mplayer/example.cong configuration file totally commented out (like you have atm) and your ~/.mplayer/config should only contain
    ao=alsa
    ok i just followed the wiki and your advices and doesn't work, yet
    mplayer -ao alsa /dati/Musica/StudyDue.mp3
    MPlayer SVN-r36498-snapshot-4.8.2 (C) 2000-2013 MPlayer Team
    206 audio & 433 video codecs
    mplayer: could not connect to socket
    mplayer: No such file or directory
    Failed to open LIRC support. You will not be able to use your remote control.
    Playing /dati/Musica/StudyDue.mp3.
    libavformat version 55.19.104 (internal)
    Audio only file format detected.
    Load subtitles in /dati/Musica/
    ==========================================================================
    Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
    AUDIO: 22050 Hz, 2 ch, s16le, 32.0 kbit/4.54% (ratio: 4000->88200)
    Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
    ==========================================================================
    [AO_ALSA] Playback open error: No such file or directory
    Failed to initialize audio driver 'alsa'
    Could not open/initialize audio device -> no sound.
    Audio: no sound
    Video: no video
    Exiting... (End of file)

  • MP3+ USB External Card doesn't work when plugged into USB

    My MP3+ USB external sound card doenst' work whenever I plug it into my usb hub.
    Model: sb0270
    First I tried a powered D-link 7 port usb 2.0 hub. (model DUB-H7, H/W ver: 2) although the model number doens't tell you much is has the same model number as a USB/Firewire hub with 3/4 ports.
    The sound card is recognized as a "composite" device. But no sound goes "through" it (light doesn't flash).
    I'm now using a Belkin 7 port usb 2.0 hub, model f5u237 rev. 3.
    When I plug the soundcard into my computer it stops the laptop speakers, and then my sound system starts playing. When I unplug it my sound system stops, and then my laptopspears start playing. When I plug it into the USB hub the sound on my laptop speakers stops, windows finds a USB composite device, then the sound starts playing on my laptop speakers again.
    I've tried this on 2 computers a HP ZV600 and a HP dv5040us.
    dv5040us specs: http://h0025.www.hp.com/ewfrf/wc/genericDocument?cc=us&docname=c00584686&lc=en&jump id=reg_R002_USEN
    This is the only USB device I have that is not functioning correctly. (2 HDDs, keyboard, mouse, printer, mp3 player, controller, and joystick)
    Even if those arn't plugged it it still doens't work.

    I tried with another USB flash card and with a smaller file.
    The transferring from Mac to the card starts but is extremely slow ( around 0,5MB/sec)

  • The sound doesn't work on my recently purchased hp laptop computer

    Hi,
    The sound doesn't work on my recently purchased hp computer. It stays on mute. Can I get someone in Lower Hutt NZ to call to fix this problem?
    Thanks. 
    Steve Taylor

    Sorry, but this is a peer-to-peer user supported forum. HP maintains no official presence on this forum. HP is unlikely to contact you via this forum. Any response you receive from a HP employee is that of their own and not on behalf of HP.
    When requesting assistance, please provide the HP model name and/or product number of the computer in question. Also provide the brand and model of monitor, connection means (HDMI, DVI, VGA, etc.), and if you have external speakers connected to your computer.
    Please send KUDOs
    Frank
    {------------ Please click the "White Kudos" Thumbs Up to say THANKS for helping.
    Please click the "Accept As Solution" on my post, if my assistance has solved your issue. ------------V
    This is a user supported forum. I am a volunteer and I don't work for HP.
    HP 15t-j100 (on loan from HP)
    HP 13 Split x2 (on loan from HP)
    HP Slate8 Pro (on loan from HP)
    HP a1632x - Windows 7, 4GB RAM, AMD Radeon HD 6450
    HP p6130y - Windows 7, 8GB RAM, AMD Radeon HD 6450
    HP p6320y - Windows 7, 8GB RAM, NVIDIA GT 240
    HP p7-1026 - Windows 7, 6GB RAM, AMD Radeon HD 6450
    HP p6787c - Windows 7, 8GB RAM, NVIDIA GT 240

  • Macbook pro buzzing, sound doesn't work, disk is falsely full...

    My 15 inch macbook pro has started buzzing a lot lately at random times.  I've had it since 2009, but it's a 2008 model, and I don't know if it's just getting old and telling me that it's going to die soon, or if there's something I can do about it. 
    It also has other problems, like the sound doesn't work when I start it up (the volume icon is greyed out), and doesn't work again until I've restarted it twice. 
    Also, when I have programs open, it'll tell me that my disk is full and I only have a few mb of disk space left even if I had many GB available before I opened the programs.  I tried fixing this on my own by not having multiple programs open at once, but the disk space won't come back until I restart the computer.  It only started doing this a few months ago, and I don't know why.
    I used to keep it on all the time and just let it sleep, but I've been shutting it down every day now, and I have the same problems.  I don't know what's happening, if it's my fault, or if my computer is just dying, but I need it for animation school and professional photography so if possible I want a heads up if it's about to crash on me.
    Thank you.

    This worked for me
    Reboot the Mac and as soon as you hear the boot chime, hold down the Command+Option+P+R keys together
    When you hear the boot sound again, the PRAM has been reset so let the Mac boot again as usual
    At this point your Mac should boot again as usual and no longer have the black display, loading OS X as usual.

  • HT1657 I rented a movie and the sound doesn't work, how do I fix it?, who do I direct to for a complaint?

    Hi, I rented warhorse HD, and the sound doesn't work, my itunes version is 10.6.1(7). How do I fix it or who do I direct to get my money back? Thank you

    I'd report the problem to the iTunes Store.
    Log in to the Store. Click on "Account" in your Quick Links. When you're in your Account information screen, go down to Purchase History and click "See all".
    Find the item that is not playing properly. If you can't see "Report a Problem" next to the entry, click the "Report a problem" button. Now click the "Report a Problem" link next to the item.
    (Not entirely sure what happens after you click that link, but fingers crossed it should be relatively straightforward.)

  • I have just updated my software to 10.8.2 and now my sound doesn't work. Any suggestions?

    I have just updated my software to 10.8.2 and now my sound doesn't work. Any suggestions?

    I used disk permission repair to try to resolve this as well as a 'soft' restart. Still have a grayed-out mute checkbox in the sound section of system preferences.

  • Sound doesn't work(only in firefox). why? sound doesn't work(only in firefox). why? (adobe flash player doesn't work even thought it's installed)

    sound doesn't work (only in firefox). adobe flash player doesn't work correctly, thought it's installed. can't solve the problem. i need Sound.
    == This happened ==
    Every time Firefox opened
    == don't know

    What does the Adobe test page say?
    http://www.adobe.com/software/flash/about/
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    You can use "Disable all add-ons" on the ''Safe mode'' start window.
    You have to close and restart Firefox after each change via "File > Exit" (on Mac: "Firefox > Quit")
    See also [[No sound in Firefox]] and [[Video or audio does not play]]

  • I have some problem with my computer because when i turn it up, the screen turns in a blue colour and the sound doesn't work and in this way i can't hear anything

    i have some problem with my computer because when i turn it up, the screen turns in a blue colour and the sound doesn't work and in this way i can't hear anything

    Will u help me or not?

  • After update my iPad 2 with IOS 6.0.1 the botton mute and sound + doesn't work...any solution for this??? Thanks

    After update my iPad 2 with IOS 6.0.1 the botton mute and sound + doesn't work...any solution for this??? Thanks

    There are numerous reports of this issue happening on iPhones. It may be a glitch that will need a new update. Some find that a full shut-down and restart fixes that problem, but not always.

  • My sound doesn't work, how do i reset my mac?

    my sound doesn't work, how do i reset my mac?

    Reset PRAM. Some sound settings are stored in P-ram.
    Check   System Preference > Sound > Inline Speakers is highlighted.

  • After upgrade my iphone 4 to IOS6, sound doesn't work correctly

    After upgrade my iphone 4 to IOS6, sound doesn't work correctly.
    During a phone call, there is no sound. But if I turn on the speaker, there is sound. itune works fine since it's on the speaker.

    Dear All
    i have done the same activity ( buy a new iphone 4 -> upgrade to ios5 - > configure email) with success-
    than when i start to move the contacts from old mobile to iphone (using the microsim) i receive the same crash
    in disgnosis e use i saw 2 dump with this title 'latestCrash-Preferences.plist and LatestCrash.plist. in each file the date is the same and i read:
    Exception Tyle: EXC_CRASH (SIGABRT)
    Exception code: 0x00000000, 0x00000000
    Chrashed Thread: 6
    in thread 6: name: Dispatch queue:
    com.apple.addressBookUI.ContactsSettingPlugin
    and thaan a lot of data.
    Have you any idea?
    thank in advance
    Fabio

  • My ipod touch is not syncing, itunes store won't load, and icloud doesn't work!!!!!

    My ipod touch is not syncing, itunes store won't load, and icloud doesn't work!!!!!

    Try the standard fixes:
    - Reset. Nothing is lost
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Restore from backup
    - Restore to factory defaults/new iPod

  • In my wife's window, the sound works, when I switch over to my window the sound doesn't work.  I noticed the problem when I went to a YouTube video.  How do I correct this?

    In my wife's window, the sound works, when I switch over to my window the sound doesn't work.  I noticed the problem when I went to a YouTube video.  How do I correct this?

    Hello Kiira Doon,
    The troubleshooting steps detailed below may help get your iPhone's display to function.
    Toggle the ringer switch to see if the unit vibrates. If it does, it could be that iPhone is getting power, but is not displaying any image.
    Try turning iPhone off and then on again.
    While connected to the iPhone charger, try to reset the iPhone.
    If the low-battery screen appears, charge the iPhone.
    My issue is still not resolved. What do I do next?Contact Apple Support.
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/TS2802
    Cheers,
    Allen

  • IPad 2 sound doesn't work... The alarms work just sound to everything else..any ideas?, iPad 2 sound doesn't work... The alarms work just sound to everything else..any ideas?

    My sound doesn't work for anything but the alarms work.. Any ideas

    Did you check the switch on the side, next to the volume controls? Is it set to turn off the sound in Settings/General/Side switch?
    Can you hear sound if you change the settings for your ringtone for example?

Maybe you are looking for

  • Office 2013 cannot open documents from SharePoint 2007 with IE 11.

    Hei  One of my client cannot open word documents (office 2013) from SharePoint 2007 with IE11. Are there any compatibility issues among Office 2013/SharePoint 2007/Internet Explorer 11? Thanks in advance.  

  • Apple Apps like Weather, the App Store and even the Facebook App don't work on WIFI

    Since a few days all my apple apps (Itunes, AppStore, Weather) don't work via Wifi. The strange thing is that all other apps work without problems (just Facebook and Youtube don't view profile pictures). Via 3G all apps work without any problems. I j

  • Using an iMac with Premiere?

    I'm thinking of getting an iMac to work with CS6 to do some light editing, I work in design but I am not a dedicated editor. Curious to hear from any iMac users what they think of editing in CS6 on an iMac, and and suggestions they may have? I plan t

  • Free or cheap readability statistics?

    We'd like to start getting readability statistics (like Flesch-Kincaid or Gunning-Fox) on our .PDF docs. We don't have a big budget. Does anyone have any experience with any utilities that can determine readability statistics, work with .PDF docs, an

  • ITunes 10.5 has an invalid signature, it will not install

    I was trying to update my iphone 4 but it says a new itunes to 10.5 should be installed first.  But when I hit the download itunes it says it has an invalid signature and will not be installed (These includes the shared files, Quick Time and Safari).