1 Reply Latest reply on Aug 9, 2009 11:15 AM by geo-bart

    Embedding TWO youtube videos in Flex

    geo-bart

      Hello,

       

      I've embedded a youtube video in Flex using the following code:

       

       

       

       

       

      <mx:Script>

      <![CDATA[

       

      import mx.managers.PopUpManager;

       

       

      import mx.controls.Text;

       

       

      private function InitOrion():void

      {

       

      var urlOrion:String = "http://www.youtube.com/v/89VFb9t69nM";

      Security.allowDomain(urlOrion)

      youtubevidOrion.load(urlOrion);

      }

      ]]>

       

       

      </mx:Script>

       

       

      <mx:Canvas height="420" x="0" y="0">

       

      <mx:SWFLoader id="youtubevidOrion" verticalAlign="top" horizontalAlign="center" left="0" width="595" height="474" />

       

      <mx:Canvas x="0" y="363" >

       

       

       

       

       

       

      This works fine. However, when I add another embedded Youtube video using this morsel of code;

       

       

       

       

       

       

       

       

       

      <mx:Script>

      <![CDATA[

       

       

       

      import mx.managers.PopUpManager;

       

       

      import mx.controls.Text;

       

       

      private function InitUrsa():void{

       

       

       

       

       

       

      var urlUrsa:String = "http://www.youtube.com/v/hepzUgFhgis";

      Security.allowDomain(urlUrsa)

      youtubevidUrsa.load(urlUrsa);

      }

      ]]>

       

       

      </mx:Script>

       

       

      <mx:Canvas height="420" x="" y="0">

       

       

       

      <mx:SWFLoader id="youtubevidUrsa" verticalAlign="top" horizontalAlign="center" left="0" width="595" height="474" />

       

       

       

      <mx:Canvas x="0" y="363" >

       

       

       

       

       

       

       

       

       

      Only one of the videos seems embedded. Flex has a way of making things vanish like a magician would do with white rabbits ;-)).

       

       

       

       

      I'd really love it when someone could point out what I did wrong. Thanks alot,

       

      Bart,

       

      Geography and sciences teacher