0 Replies Latest reply on Oct 16, 2007 6:02 AM by Vikki_Yates

    my google videos wont unload! :(

    Vikki_Yates
      Pease help!
      I have the following code in a swf file to load the external video from google video which works fine:

      Code:


      //Actionscript code
      System.security.allowDomain(" http://video.google.com/");
      System.security.loadPolicyFile(" http://video.google.com/crossdomain.xml");
      Stage.scaleMode = "noScale";

      this.createEmptyMovieClip("container",this.getNextHighestDepth());
      container.createEmptyMovieClip("subcontainer",this.getNextHighestDepth());
      var stgHeight = Stage.height;
      var stgWidth = Stage.width;
      _root._lockroot = true;
      _root.container._lockroot = true;
      _root.container.subcontainer._lockroot = true;
      var mclListener:Object = new Object();

      mclListener.onLoadStart = function(target_mc:MovieClip) {
      target_mc.startTimer = getTimer();
      };

      mclListener.onLoadComplete = function(target_mc:MovieClip) {
      target_mc.completeTimer = getTimer();
      };

      mclListener.onLoadInit = function(target_mc:MovieClip) {
      var timerMS:Number = target_mc.completeTimer-target_mc.startTimer;
      //trace("loaded in "+timerMS+" ms.");
      };

      var video_mcl:MovieClipLoader = new MovieClipLoader();
      video_mcl.addListener(mclListener);

      //waits till some content has been loaded
      this.onEnterFrame = function() {
      if (container._width>0) {
      //height and width of youtube movie
      cWidth = container._width;
      cHeight = container._height;
      //trace('widthxheight = '+cWidth+"x"+cHeight);
      //required height and width in which to fit the youtube movie
      rCWidth = 620;
      rCHeight = 346;
      container._xscale = (rCWidth/cWidth)*100;
      container._yscale = (rCHeight/cHeight)*100;
      //trace((rCWidth/cWidth)*100);
      //trace((rCHeight/cHeight)*100);
      //manual placement of the mc
      container._x = 205;
      container._y = 135;
      delete this.onEnterFrame;
      }
      };


      Still_imagery1.onPress = function() {
      //when you unload the movie, sounds remains playing, so we need this line
      stopAllSounds();
      //without this line the other video keeps playing
      video_mcl.unloadClip(container.subcontainer);
      //your video address
      my_video_id = "6083988774814179881"
      full_address = " http://video.google.com/googleplayer.swf?docId=" + my_video_id + "&hl=en-GB";
      //ready to load
      video_mcl.loadClip(full_address, container.subcontainer);

      }





      This loads the video into the container

      The YouTube video loads correctly. When I click another button in my menu to play another rmovie or to jump to a frame with no video or audio the video disappears, but the sound continues. the strange thing is that the swf works fine and video stops when testing it within flash, im confused!

      Please help i need this site up and running tomorrow! :S

      Thankyou,
      vikki.