views:

22

answers:

1

I'm making this small app in Flash CS5 using AS3. Sounds are being reproduced using flash.media.Sound and flash.media.SoundChannel. Locally , everything sound perfect, but when I run the game from a server it just goes mute.

Any help is apreciated.

Thanks.

A: 

It looks like a security issue, you need to use a crossdomain policy file.

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM
 "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd"&gt;

<cross-domain-policy>
   <site-control permitted-cross-domain-policies="master-only"/>
   <allow-access-from domain="yourDomainName.com"/>
</cross-domain-policy>

and when loading a Sound , you do this:

private var sound:Sound = new Sound();
private var bufferTime:Number = 1000;// set your bufferTime here
// the second argument sets checkPolicyFile to true
private var context:SoundLoaderContext 
                  = new SoundLoaderContext( bufferTime , true );

//anywhere in your code
//assuming you have defined your URLRequest variable.
sound.load( request , context );
PatrickS