1 Reply Latest reply on Feb 8, 2011 4:13 AM by Gurdeep Singh

    Flash Builder embed video in different stages


      Hi, I'm Paulinho Cé from Brasil and i have a problem to embed youtube videos on my site in different stages FlashBuilder.

      I have 10 videos and want to display them in the event of each button corresponding to a different stage.

      This code works in the main application but not in the stages of the site, because the functions and variables are global and can not change the url of the video to a video display differently at each stage.



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

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

      layout="absolute" verticalAlign="top"

      creationComplete="Init();" >



      private function Init():void


      var url:String = "http://www.youtube.com/v/zlfKdbWwruY&hl=en&fs=1"; //url extracted from embed code

      Security.allowDomain(url); //allow domain

      youtubevid.load(url); //load video




      <mx:VBox width="100%" height="100%" horizontalAlign="center" verticalAlign="top" verticalGap="0">

      <mx:Label text="YouTube Video Embedded Inside Flex" width="100%"  color="#060809" textAlign="center" fontSize="16" fontWeight="bold"/>

      <mx:SWFLoader id="youtubevid" verticalAlign="top" horizontalAlign="center"  width="425" height="344"/>



      <iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/kdhuQJRW6kA" frameborder="0" allowfullscreen></iframe>



      Because this solution is of extreme importance to me, I requestthe help of experts, which immensely grateful.


      Thanks for all,




      Paulinho Cé