3 Replies Latest reply on May 24, 2006 7:52 AM by zensoldier

    Script to receive width, height, movie url

    cmmaso
      I'm a complete Flash neophyte, but despite this I've been tasked at work with creating an actionscript for a fla file that will receive width, height, and URL (of a .flv file) as arguments so that the file can dynamically display video based on the arguments passed. I have to have this done by tomorrow...would anyone be kind enough to throw me a clue or two on how this could be done? I'm looking through the tutorials and documentation, but they all look like they're for intermediate to advanced Flash users. I know javascript fairly well, so I think I get the general concept, but I'm in the dark as to syntax, proper object and properties to refer to, what the function would look like or where to save it...

      Any help would put me way in your debt.

      Thanks,
      Christophe
        • 1. Re: Script to receive width, height, movie url
          zensoldier Level 1
          function setVideo(newWidth, newHeight, newURL)
          {
          _root.videoGizmo._height = newHeight;
          _root.videoGizmo._width = newWidth;

          //then set the filename. That will be different depending on what video component you are using. If you are using flash 8 and using the flash 8 video playback component then it will be the contentPath like so

          _root.videoGizmo.contentPath = newURL;

          }

          Keep in mind that if you are using flash 8 and that's OK for users then then video playback component will autosize for you if you set its autosize property to true.
          • 2. Re: Script to receive width, height, movie url
            cmmaso Level 1
            Thanks very much! Looks pretty straightforward. I'm assuming that "_root" is literally "_root" and is part of actionscript's object model... As for "videoGizmo" - at the risk of seeming dense, I'm not clear on what object this is or what text should be placed here. The name of the swf?
            • 3. Re: Script to receive width, height, movie url
              zensoldier Level 1
              The videoGizmo is whatever you are using to display the video. The thing you are trying to re-size.

              I don't know if you are using a video component or a movieclip, so I refer to the thing you are putting the video into for playback as the videoGizmo.