# Cannot play embedded sounds in FlashDevelop

**URL:** <https://forum.kirupa.com/t/cannot-play-embedded-sounds-in-flashdevelop/329697>\
**Category:** flash\
**Created:** [October 3, 2012, 10:50pm UTC](https://forum.kirupa.com/t/cannot-play-embedded-sounds-in-flashdevelop/329697 "2012-10-03T22:50:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alpha\_Remex](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@Alpha\_Remex](https://forum.kirupa.com/u/Alpha_Remex)\
**Post date:** [October 3, 2012, 10:50pm UTC](https://forum.kirupa.com/t/cannot-play-embedded-sounds-in-flashdevelop/329697/1 "2012-10-03T22:50:00Z")

</div>

Hello everyone - I’m at my wit’s end at this point… I am using FlashDevelop and am trying to either play an embedded sound clip or to load it and play it: both methods aren’t working.

Here is some of what I’ve tried:  
Normal embedding:

```auto
public class SoundPlayer extends Sprite
    {
        [Embed(source = "../../lib/sounds/levelUp.mp3")]
        private const _levelUpClass:Class;
        
        public function SoundPlayer():void 
        {
        }
        
        public function playLevelUp():void 
        {
            var snd:Sound = new _levelUpClass() as Sound; 
            snd.play();
        }
    }

```

Loading gives me a security error: (SecurityError: Error #2000: No active security context.)

```auto
var mySound:Sound = new Sound();
            var myChannel:SoundChannel = new SoundChannel();
            var myTransform = new SoundTransform();
            var lastPosition:Number = 0;
            mySound.load(new URLRequest("../../lib/sounds/levelUp.mp3"));
            myChannel = mySound.play();
            myTransform.volume = 0.5;

```

Also, I tried adding context and got the same error:

```auto

var snd:Sound = new Sound();
            var req:URLRequest = new URLRequest("../../lib/sounds/levelUp.mp3");
            var context:SoundLoaderContext = new SoundLoaderContext(0, true);

            snd.load(req, context);
            snd.play();   

```

I don’t really care how the sound is played, but I need it to play… this is the first time I’ve worked with sounds in AS3 (first time I’ve needed to).

Any ideas?

EDIT: hey folks, I figured out that the file was semi-corrupt, for lack of a better term. It worked in other music players, but not in Flash… I replaced the file and voila!
