6 Replies Latest reply on Jun 29, 2006 8:27 PM by Newsgroup_User

    Can't get FLVPlayer to read Flashvars

    Level 7
      Sorry if this is trivial but I am new to Actionscript and have spent
      couple of days messing about with this.

      I am using FLVPlayer and have added these lines to the HTML page:

      <param name="FlashVars" value="thisVideo=clouds.flv" />

      <embed src="myflvplayer.swf" FlashVars="thisVideo=clouds.flv"
      quality="high" bgcolor="#ffffff" width="320" height="240"
      name="myflvplayer" align="middle" allowScriptAccess="sameDomain"
      type="application/x-shockwave-flash"
      pluginspage=" http://www.macromedia.com/go/getflashplayer" />

      The file myflvplayer.swf has two lines of AS in Layer 1: Frame 1

      import mx.video.*;
      myVideo.contentPath = thisVideo;

      It doesn't work. If I change the last line to

      myVideo.contentPath = "clouds.flv";

      then it does work. So it seems the value for thisVideo isn't being
      read by the AS. Can anyone tell me what I am doing wrong?

      (Incidenatlly, flv, swf and html are in the same directory).
      --
      Steve
      steve at flyingtigerwebdesign dot com
        • 1. Re: Can't get FLVPlayer to read Flashvars
          panell Level 1
          This should work:

          At first try to display variable and check if it is loaded properly.
          1. Create new layer on the top and Create Text Field there
          2. Set tex field type to dynamic
          3. In properties panel in "Var" field enter variable name thisVideo
          • 2. Re: Can't get FLVPlayer to read Flashvars
            Level 7
            On Wed, 28 Jun 2006 14:22:50 +0000 (UTC), "panell"
            <webforumsuser@macromedia.com> wrote:

            > At first try to display variable and check if it is loaded properly.
            > 1. Create new layer on the top and Create Text Field there
            > 2. Set tex field type to dynamic
            > 3. In properties panel in "Var" field enter variable name thisVideo

            I did this but nothing is being displayed in the textbox.
            --
            Steve
            steve at flyingtigerwebdesign dot com
            • 3. Re: Can't get FLVPlayer to read Flashvars
              Level 7
              Have you tried using _root.thisVideo or _level0.thisVideo? i.e.

              myVideo.contentPath = _level0.thisVideo;
              • 4. Re: Can't get FLVPlayer to read Flashvars
                Level 7
                On Wed, 28 Jun 2006 19:35:33 -0400, ImagicDigital
                <danya_REMOVE@imagicdigital.com> wrote:

                >Have you tried using _root.thisVideo or _level0.thisVideo? i.e.
                >
                >myVideo.contentPath = _level0.thisVideo;

                Yes, I tried both of those but with no apparent success.
                --
                Steve
                steve at flyingtigerwebdesign dot com
                • 5. Re: Can't get FLVPlayer to read Flashvars
                  Level 7
                  Steve - You might need to URLEncode the "." when passing in your string.
                  Flash reads "%2E" as ".", Can't test this right now, but you should try:

                  FlashVars="thisVideo=clouds%2Eflv"

                  I usually add the ".flv" on after passing the rest of the string,
                  sending a var like "clouds" and using

                  myVideo.contentPath = thisVideo + ".flv";

                  Also, you can try appending the vars to the SWF URI, like so:

                  src="myflvplayer.swf?thisVideo=clouds%2Eflv"

                  Remember to add to both the object and embed tags, if you try this out.
                  • 6. Re: Can't get FLVPlayer to read Flashvars
                    Level 7
                    On Thu, 29 Jun 2006 13:18:42 -0400, ImagicDigital
                    <danya_REMOVE@imagicdigital.com> wrote:

                    >Steve - You might need to URLEncode the "." when passing in your string.
                    > Flash reads "%2E" as ".", Can't test this right now, but you should try:
                    >
                    >FlashVars="thisVideo=clouds%2Eflv"
                    >
                    >I usually add the ".flv" on after passing the rest of the string,
                    >sending a var like "clouds" and using
                    >
                    >myVideo.contentPath = thisVideo + ".flv";
                    >
                    >Also, you can try appending the vars to the SWF URI, like so:
                    >
                    >src="myflvplayer.swf?thisVideo=clouds%2Eflv"
                    >
                    >Remember to add to both the object and embed tags, if you try this out.

                    Thanks Imagic I'll try this!
                    --
                    Steve
                    steve at flyingtigerwebdesign dot com