Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: AS2 problem

  1. #1
    New Coder
    Join Date
    Jan 2012
    Posts
    55
    Thanks
    18
    Thanked 0 Times in 0 Posts

    AS2 problem

    Code:
    System.security.allowInsecureDomain( '*' );
    System.security.allowDomain( '*' ); 
    System.security.allowDomain( 'www.youtube.com' ); 
    System.security.allowInsecureDomain( 'www.youtube.com' );
    System.security.allowDomain( 'youtube.com' ); 
    System.security.allowInsecureDomain( 'youtube.com' ); 
    System.security.allowDomain( 's.ytimg.com' );
    System.security.allowInsecureDomain( 's.ytimg.com' );
    System.security.allowDomain( 'i.ytimg.com' ); 
    System.security.allowInsecureDomain( 'i.ytimg.com' ); 
    System.security.loadPolicyFile("http://i.ytimg.com/crossdomain.xml"); 
    System.security.loadPolicyFile("http://i1.ytimg.com/crossdomain.xml"); 
    System.security.loadPolicyFile("http://i2.ytimg.com/crossdomain.xml"); 
    System.security.loadPolicyFile("http://i3.ytimg.com/crossdomain.xml"); 
    System.security.loadPolicyFile("http://i4.ytimg.com/crossdomain.xml"); 
    System.security.loadPolicyFile("http://s.ytimg.com/crossdomain.xml"); 
    System.security.loadPolicyFile("http://www.youtube.com/crossdomain.xml");
    
    
    // create a MovieClip to load the player into
    var ytplayer:MovieClip = _root.createEmptyMovieClip("ytPlayer", 1);
    
    ytPlayer._x = 221
    ytPlayer._y = 300
    ytPlayer._xscale = 75
    ytPlayer._yscale = 75
    
    // create a listener object for the MovieClipLoader to use
    var ytPlayerLoaderListener:Object = {
      onLoadInit: function() {
        // When the player clip first loads, we start an interval to
        // check for when the player is ready
        loadInterval = setInterval(checkPlayerLoaded, 250);
      }
    };
    
    var loadInterval:Number;
    
    
    function checkPlayerLoaded():Void {
        // once the player is ready, we can subscribe to events, or in the case of
        // the chromeless player, we could load videos
        if (ytplayer.isPlayerLoaded()) {
            ytplayer.addEventListener("onStateChange", onPlayerStateChange);
            ytplayer.addEventListener("onError", onPlayerError);
            clearInterval(loadInterval);
        }
    }
    
    function onPlayerStateChange(newState:Number) {
        trace("New player state: "+ newState);
    }
    
    function onPlayerError(errorCode:Number) {
        trace("An error occurred: "+ errorCode);
    }
    
    // create a MovieClipLoader to handle the loading of the player
    var ytPlayerLoader:MovieClipLoader = new MovieClipLoader();
    ytPlayerLoader.addListener(ytPlayerLoaderListener);
    
    // load the player
    myLoadVars = new LoadVars();
    myLoadVars.onLoad = function() {
    zal = myLoadVars.myHTMLdata;
    
    
    ytPlayerLoader.loadClip(zal, ytplayer);
    };
    myLoadVars.load("youtubelink.txt");
    //scale it
    
    _root.ytplayer._x = 221
    _root.ytplayer._y = 300
    _root.ytplayer._xscale = 75
    _root.ytplayer._yscale = 75
    and my output which is my problem

    Code:
    *** Security Sandbox Violation ***
    SecurityDomain 'http://s.ytimg.com/crossdomain.xml' tried to access incompatible context 'http://www.youtube.com/crossdomain.xml'

    everything appear and the movie clip but i cant remove the movie clip anymore cuz that error is there which stops it from removing...

    so any idea???

    thnx in advance

  • #2
    New Coder
    Join Date
    Jan 2012
    Posts
    55
    Thanks
    18
    Thanked 0 Times in 0 Posts
    bump -too short-

  • #3
    New Coder
    Join Date
    Jan 2012
    Posts
    55
    Thanks
    18
    Thanked 0 Times in 0 Posts
    bump -any help, please

  • #4
    New Coder
    Join Date
    Jan 2012
    Posts
    55
    Thanks
    18
    Thanked 0 Times in 0 Posts
    bumpppp

    help is so needed

  • #5
    New Coder
    Join Date
    Jan 2012
    Posts
    55
    Thanks
    18
    Thanked 0 Times in 0 Posts
    that means it got no any solution?

  • #6
    New Coder
    Join Date
    Jan 2012
    Location
    Columbus, Ohio, U.S.A
    Posts
    41
    Thanks
    0
    Thanked 8 Times in 8 Posts
    hi

    I'm sure there is an answer to your question but some of us (me included) just don't have enough expertise to answer this.

    there are some guys over at actionscript.org that could probably answer this, you should try there.

    I'm guessing you'll need to do some kind of error handling (in case this happens) like a try-catch block or something. That way you can catch the error and still be able to remove the stuff you need to get rid of

    -Adam


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •