title: Flash AS3 Security Sandbox Violation / s.ytimg.com
body: <p>I have been reading about this trouble for days now and i'm going mad. Please Help!</p>
  
  <p>I'm trying to load in vain a YouTube video into my portfolio. I'v uploaded the video on Youtube and it's Public. 
  I've tried the code with a bunch of other Youtube videos and it works perfect with them all except with mine...
  Like i said i'm going MAD!!! please help!!</p>
  
  <p><strong>* Security Sandbox Violation *</strong>
  SecurityDomain '<a href="http://s.ytimg.com/crossdomain.xml" rel="nofollow">http://s.ytimg.com/crossdomain.xml</a>' tried to access incompatible context 'file:///M|/Architecture/PORTFOLIO/WEB/PORTFOLIO.swf'</p>
  
  <p>Here's the code of the part in context:</p>
  
  <pre><code>import flash.display.Loader;
  import flash.net.URLRequest;
  import fl.transitions.Tween;
  import fl.transitions.easing.*;
  import flash.events.MouseEvent;
  import flash.display.MovieClip;
  import fl.controls.ProgressBar;
  import fl.controls.ProgressBar;
  import fl.transitions.TweenEvent;
  import flash.events.Event;
  import fl.controls.ProgressBar;
  import flash.ui.MouseCursor;
  import flash.system.Security;
  
  pages.visible = false;
  pages.fullPage.alpha = 0;
  var my_images:XMLList;
  var my_total:Number;
  
  var page_no:Number = 1;
  pages.pb.alpha = 0;
  
  pages.btnBallon.visible = false;
  pages.btnBallon.removeEventListener(MouseEvent.CLICK, lVid);
  pages.btnBallon.buttonMode = false;
  
  //Youtube loader
  
  Security.allowDomain("*");
  Security.allowDomain("www.youtube.com");
  Security.allowDomain("youtube.com");
  Security.allowDomain("s.ytimg.com");
  Security.allowDomain("i1.ytimg.com");
  Security.allowDomain("i.ytimg.com");
  Security.allowDomain("http://s.ytimg.com/crossdomain.xml");
  Security.allowDomain("popslinger.org");
  Security.allowDomain("http://www.box.net/api/crossdomain.xml");
  
  Security.loadPolicyFile("http://i.ytimg.com/crossdomain.xml");
  Security.loadPolicyFile("http://www.youtube.com/crossdomain.xml");
  Security.loadPolicyFile("http://s.ytimg.com/crossdomain.xml");
  Security.loadPolicyFile('http://youtube.com/crossdomain.xml');
  Security.loadPolicyFile("http://www.box.net/api/crossdomain.xml");
  
  
  
  function video():void{
  pages.btnBallon.visible = true;
  pages.btnBallon.addEventListener(MouseEvent.CLICK, lVid);
  pages.btnBallon.buttonMode = true;
  }
  
  function lVid(e:Event = null):void{
  
  loader.load(new URLRequest("http://www.youtube.com/apiplayer?version=3"));
  
  loader.contentLoaderInfo.addEventListener(Event.INIT, onInit);
  }
  
  function onInit(e:Event):void{
  addChild(loader);
  player = loader.content;
  player.addEventListener("onReady",onPlayerReady);
  }
  
  function onPlayerReady(e:Event):void{
  var pageTween:Tween = new Tween(pages.fullPage, "alpha",     Strong.easeOut,pages.fullPage.alpha, 0, 1, true);
  player.setSize = (560,315);
  player.x = pages.x + 120;
  player.y = pages.y;
  pages.visible = false;
  pages.btnBallon.visible = false;
  pages.btnBallon.removeEventListener(MouseEvent.CLICK, lVid);
  pages.btnBallon.buttonMode = false;
  /*pages.btnNext.removeEventListener(MouseEvent.CLICK, nextPage);
  pages.btnNext.visible = false;
  pages.btnPrev.removeEventListener(MouseEvent.CLICK, nextPage);
  pages.btnPrev.visible = false;*/
  player.loadVideoByUrl("www.youtube.com/embed/omcl93EYTrM",0);
  //player.loadVideoById("omcl93EYTrM",0);    
  
  }
  </code></pre>