maxwel
03-08-2012, 10:28 AM
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
*** 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
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
*** 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