0 Replies Latest reply on Nov 15, 2010 5:40 AM by vasilip_

    Youtube Chromeless player - works properly in 3.5, NOT in flex 4

    vasilip_

      I get security errors when the youtube player tries to pass on mouse events. This only happens when compiling against flex 4 & 4.1 sdks. It works perfectly when compiling with the 3.5 sdk. It happens both when viewed as a local file as well as when its server off a webserver.

       

      the errors are in the form...

      *** Security Sandbox Violation ***

      SecurityDomain 'http://www.youtube.com/apiplayer?version=3' tried to access incompatible context 'file:///D:/_DESKTOP_DATA/Adobe Flash Builder 4/test4.1/bin-debug/test2.html'

       

      as well as

       

      *** Security Sandbox Violation ***

      SecurityDomain 'http://www.youtube.com/apiplayer?version=3' tried to access incompatible context 'http://local.test.com/test4.1/bin-debug/test2.html'

       

      I've searched and read anything I could find that refferences such an issue and everyone is going on about the Security.allowDomain() call. I agree, this DOES solve the problem but only in FLEX 3.5  not in 4!

       

      does anyone have any ideas?

       

      I have attached my simple sample code below.

       

      <?xml version="1.0" encoding="utf-8"?>

      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"

      layout="absolute"

      minWidth="955"

      minHeight="600"

      initialize="{go();}">

      <mx:VBox>

      <mx:Label id="test" text=""/>

      <mx:SWFLoader source="http://www.youtube.com/apiplayer?version=3" />

      </mx:VBox>

      <mx:Script>

      <![CDATA[

      function go(){

      Security.allowDomain("www.youtube.com");

      addEventListener(MouseEvent.MOUSE_MOVE, function(e:MouseEvent){trace(test.text=e.stageX+"")});

      }

      ]]>

      </mx:Script>

      </mx:Application>