Function in Param Tag?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Keeko

    Function in Param Tag?

    Actionscriptor needs help!

    I have a working javascript function (getVar()) that extracts a variable
    from a link and returns it. (tested with alert() works fine). But I am
    unsure of how to right the following line.

    document.write( "<param name='flashVars ' value=&{getVar( text)}>)

    This is a param from an object tag (embedding flash) and i'm trying to
    dynamically set the flashVars param, but this 1 line is killing me.

    How do i properly right this line?

    Many Thanks in advance..



  • RobB

    #2
    Re: Function in Param Tag?

    Keeko wrote:[color=blue]
    > Actionscriptor needs help!
    >
    > I have a working javascript function (getVar()) that extracts a[/color]
    variable[color=blue]
    > from a link and returns it. (tested with alert() works fine). But I[/color]
    am[color=blue]
    > unsure of how to right the following line.
    >
    > document.write( "<param name='flashVars ' value=&{getVar( text)}>)
    >
    > This is a param from an object tag (embedding flash) and i'm trying[/color]
    to[color=blue]
    > dynamically set the flashVars param, but this 1 line is killing me.
    >
    > How do i properly right this line?
    >
    > Many Thanks in advance..[/color]

    document.write( '<param name="flashVars " value="' + getVar(text) +
    '">');

    Comment

    • Keeko

      #3
      Re: Function in Param Tag?

      Thanks Rob. It's still not working however. I'll assume based on your
      example, that I can't have the function defined withing the quotes of the
      write("") statement. but still not working.

      Question. Do i need to have the document.write( ... withing a <script> tag???
      i've tried both but it doesn't work either way. Here's some of the page.


      ---------------------
      <script language="javas cript">
      var locate = window.location // Get the link string
      document.hidden Form.hiddenInpu t.value = locate // put the link string into a
      hidden form.
      var text = document.hidden Form.hiddenInpu t.value

      function getVar(str){
      theVar = str.indexOf("=" ) + 1;
      return("myVar=" +str.substring( theVar));
      }

      </script>

      <object classid="clsid: D27CDB6E-AE6D-11cf-96B8-444553540000"
      codebase="http://download.macrom edia.com/pub/shockwave/cabs/flash/swflash.cab#ver sion=6,0,29,0"
      width="500" height="500">
      <param name="movie" value="varTest. swf">
      document.write( '<param name="flashVars " value="'+getVar (text)+'">');
      <param name='menu' value='false'>"
      <param name="quality" value="high">

      </object>
      <script language="javas cript">alert(ge tVar(text)); //Tests fine </script>
      </body>
      </html>
      ---------------------

      Thanks for the help!





      "RobB" <ferndoc9@hotma il.com> wrote in message
      news:1107889269 .230058.169030@ o13g2000cwo.goo glegroups.com.. .[color=blue]
      > Keeko wrote:[color=green]
      >> Actionscriptor needs help!
      >>
      >> I have a working javascript function (getVar()) that extracts a[/color]
      > variable[color=green]
      >> from a link and returns it. (tested with alert() works fine). But I[/color]
      > am[color=green]
      >> unsure of how to right the following line.
      >>
      >> document.write( "<param name='flashVars ' value=&{getVar( text)}>)
      >>
      >> This is a param from an object tag (embedding flash) and i'm trying[/color]
      > to[color=green]
      >> dynamically set the flashVars param, but this 1 line is killing me.
      >>
      >> How do i properly right this line?
      >>
      >> Many Thanks in advance..[/color]
      >
      > document.write( '<param name="flashVars " value="' + getVar(text) +
      > '">');
      >[/color]


      Comment

      • Keeko

        #4
        Re: Function in Param Tag?

        I've also stumbled across this approach but again it seems to fail. any
        Suggs???

        <param name="flashVars " value=&{getVar( text)};>


        Again, testing getVar(text) using alert(getVar(te xt)) returns correctly...

        Cheers!



        "RobB" <ferndoc9@hotma il.com> wrote in message
        news:1107889269 .230058.169030@ o13g2000cwo.goo glegroups.com.. .[color=blue]
        > Keeko wrote:[color=green]
        >> Actionscriptor needs help!
        >>
        >> I have a working javascript function (getVar()) that extracts a[/color]
        > variable[color=green]
        >> from a link and returns it. (tested with alert() works fine). But I[/color]
        > am[color=green]
        >> unsure of how to right the following line.
        >>
        >> document.write( "<param name='flashVars ' value=&{getVar( text)}>)
        >>
        >> This is a param from an object tag (embedding flash) and i'm trying[/color]
        > to[color=green]
        >> dynamically set the flashVars param, but this 1 line is killing me.
        >>
        >> How do i properly right this line?
        >>
        >> Many Thanks in advance..[/color]
        >
        > document.write( '<param name="flashVars " value="' + getVar(text) +
        > '">');
        >[/color]


        Comment

        • RobB

          #5
          Re: Function in Param Tag?

          Keeko wrote:[color=blue]
          > I've also stumbled across this approach but again it seems to fail.[/color]
          any[color=blue]
          > Suggs???
          >
          > <param name="flashVars " value=&{getVar( text)};>
          >
          >
          > Again, testing getVar(text) using alert(getVar(te xt)) returns[/color]
          correctly...[color=blue]
          >
          > Cheers!
          >
          >
          >
          > "RobB" <ferndoc9@hotma il.com> wrote in message
          > news:1107889269 .230058.169030@ o13g2000cwo.goo glegroups.com.. .[color=green]
          > > Keeko wrote:[color=darkred]
          > >> Actionscriptor needs help!
          > >>
          > >> I have a working javascript function (getVar()) that extracts a[/color]
          > > variable[color=darkred]
          > >> from a link and returns it. (tested with alert() works fine). But[/color][/color][/color]
          I[color=blue][color=green]
          > > am[color=darkred]
          > >> unsure of how to right the following line.
          > >>
          > >> document.write( "<param name='flashVars ' value=&{getVar( text)}>)
          > >>
          > >> This is a param from an object tag (embedding flash) and i'm[/color][/color][/color]
          trying[color=blue][color=green]
          > > to[color=darkred]
          > >> dynamically set the flashVars param, but this 1 line is killing[/color][/color][/color]
          me.[color=blue][color=green][color=darkred]
          > >>
          > >> How do i properly right this line?
          > >>
          > >> Many Thanks in advance..[/color]
          > >
          > > document.write( '<param name="flashVars " value="' + getVar(text) +
          > > '">');
          > >[/color][/color]

          This -

          &{getVar(text)} ;

          ....is a JavaScript entity, a Netscape invention that allows
          interpolation of JS code directly into HTML, without a <script> block
          and document.write. Not sure if later (mozilla) version support it, but
          afaik other browsers don't, and it's rarely seen. If the above function
          tests out correctly, try outputting the entire <object> dynamically.

          <script type="text/javascript">

          document.write(

          '<object classid="clsid: D27CDB6E-AE6D-11cf-96B8-444553540000" ' ,
          'codebase="http ://download.macrom edia.com/pub/shockwave/cabs/flash/swflash.cab#v.. ."
          ' ,
          'width="500" height="500">' ,
          '<param name="movie" value="varTest. swf">' ,
          '<param name="flashVars " value="' + getVar(text) + '">' ,
          '<param name="menu" value="false">' ,
          '<param name="quality" value="high">' ,
          '</object>'

          );

          </script>

          Note that document.write takes multiple arguments, comma-separated as
          usual. And, yes - it needs to be within a <script> block (hey, it's
          script!).

          Comment

          • Keeko

            #6
            Re: Function in Param Tag?

            Enitre Object dynaically worked perfectly... Thanks!

            "RobB" <ferndoc9@hotma il.com> wrote in message
            news:1107914395 .798491.181130@ l41g2000cwc.goo glegroups.com.. .[color=blue]
            > Keeko wrote:[color=green]
            >> I've also stumbled across this approach but again it seems to fail.[/color]
            > any[color=green]
            >> Suggs???
            >>
            >> <param name="flashVars " value=&{getVar( text)};>
            >>
            >>
            >> Again, testing getVar(text) using alert(getVar(te xt)) returns[/color]
            > correctly...[color=green]
            >>
            >> Cheers!
            >>
            >>
            >>
            >> "RobB" <ferndoc9@hotma il.com> wrote in message
            >> news:1107889269 .230058.169030@ o13g2000cwo.goo glegroups.com.. .[color=darkred]
            >> > Keeko wrote:
            >> >> Actionscriptor needs help!
            >> >>
            >> >> I have a working javascript function (getVar()) that extracts a
            >> > variable
            >> >> from a link and returns it. (tested with alert() works fine). But[/color][/color]
            > I[color=green][color=darkred]
            >> > am
            >> >> unsure of how to right the following line.
            >> >>
            >> >> document.write( "<param name='flashVars ' value=&{getVar( text)}>)
            >> >>
            >> >> This is a param from an object tag (embedding flash) and i'm[/color][/color]
            > trying[color=green][color=darkred]
            >> > to
            >> >> dynamically set the flashVars param, but this 1 line is killing[/color][/color]
            > me.[color=green][color=darkred]
            >> >>
            >> >> How do i properly right this line?
            >> >>
            >> >> Many Thanks in advance..
            >> >
            >> > document.write( '<param name="flashVars " value="' + getVar(text) +
            >> > '">');
            >> >[/color][/color]
            >
            > This -
            >
            > &{getVar(text)} ;
            >
            > ...is a JavaScript entity, a Netscape invention that allows
            > interpolation of JS code directly into HTML, without a <script> block
            > and document.write. Not sure if later (mozilla) version support it, but
            > afaik other browsers don't, and it's rarely seen. If the above function
            > tests out correctly, try outputting the entire <object> dynamically.
            >
            > <script type="text/javascript">
            >
            > document.write(
            >
            > '<object classid="clsid: D27CDB6E-AE6D-11cf-96B8-444553540000" ' ,
            > 'codebase="http ://download.macrom edia.com/pub/shockwave/cabs/flash/swflash.cab#v.. ."
            > ' ,
            > 'width="500" height="500">' ,
            > '<param name="movie" value="varTest. swf">' ,
            > '<param name="flashVars " value="' + getVar(text) + '">' ,
            > '<param name="menu" value="false">' ,
            > '<param name="quality" value="high">' ,
            > '</object>'
            >
            > );
            >
            > </script>
            >
            > Note that document.write takes multiple arguments, comma-separated as
            > usual. And, yes - it needs to be within a <script> block (hey, it's
            > script!).
            >[/color]


            Comment

            Working...