In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

forked from: Security.loadPolicyFile() Ignored

not working too on my Mac10,1,82,76 debug player,
but works fine on same version non-debug.

my crossdomain.xml file is like this, and I'm sending Content-Type: text/x-cross-domain-policy 

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
  <allow-access-from domain="swf.wonderfl.net" />
  <site-control permitted-cross-domain-policies="by-content-type" />
</cross-domain-policy>
Get Adobe Flash player
by mash 16 Sep 2010

    Talk

    jozefchutka at 17 Sep 2010 15:05
    Hi mash, your code works for me (WIN 10,1,50,426 debug), however when I use your crossdomain.xml on my domain (Content-Type: application/xml) it throws error... I guess this is due to "by-content-type: [HTTP/HTTPS only] Only policy files served with Content-Type: text/x-cross-domain-policy are allowed" .... hmm ... blogged http://blog.yoz.sk/2010/09/security-loadpolicyfile-ignored-not-at-all/

    Tags

    Embed
/**
 * Copyright mash ( http://wonderfl.net/user/mash )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/ykWW
 */

// forked from jozefchutka's Security.loadPolicyFile() Ignored
package
{
    import flash.text.TextField;
    import flash.display.Sprite;
    import flash.events.*;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.system.Security;
    
    public class WonderflApp extends Sprite
    {
        private var path:String = "http://maaash.jp/lab/crossdomain-test/";
        
        public function WonderflApp():void
        {
            Security.loadPolicyFile(path + "crossdomain.xml");
            
            var tf :TextField = new TextField;
            addChild(tf);
            
            var loader:URLLoader = new URLLoader();
            loader.load(new URLRequest(path + "text.txt"));
            loader.addEventListener( Event.COMPLETE, function(ev:Event) :void {
                tf.text = loader.data as String;
            });

        }
    }
}