A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: passing values of js functions to Flash

  1. #1
    Junior Member
    Join Date
    Sep 2000
    Posts
    29
    I am having a problem passing the values of functions and variables into flash.

    I got this no problem
    <PARAM NAME="MOVIE" VALUE="flash_home.swf?docWidth=test">
    <EMBED NAME="testcommand" SRC="flash_home.swf?docWidth=test">

    But I need to do something like this.
    <PARAM NAME="MOVIE" VALUE="flash_home.swf?docWidth="+getDocWidth()>

    Does this make sense? This is one of my first tries with passing values to flash.

  2. #2
    Senior Member sxdesign's Avatar
    Join Date
    Aug 2000
    Location
    Serbia
    Posts
    844
    well... instead of:

    <PARAM NAME="MOVIE" VALUE="flash_home.swf?docWidth="+getDocWidth()>

    write:

    <PARAM NAME="MOVIE" VALUE="flash_home.swf?docWidth=
    <script language="JavaScript">
    document.write(getDocWidth());
    </script>
    >

    hope it helps...


  3. #3
    Junior Member
    Join Date
    Sep 2000
    Posts
    29

    couldn't get it!!

    sxdesign, Thanks for the help that all makes sense but it isn't passing anything. The function returns a number and I am trying to get it into Flash.

    <OBJECT
    ID="MySWF">
    <PARAM NAME="MOVIE" VALUE="flash_home.swf?docWidth="+<script language="JavaScript">
    document.write(getDocWidth());
    </script>>
    <EMBED
    NAME="MySWF"
    SRC="flash_home.swf?docWidth="+<script language="JavaScript">document.write(getDocWidth() ); </script>
    swLiveConnect="true"
    </EMBED>
    </OBJECT>

  4. #4
    The Supreme Shaman and Keeper of Polar Lights
    Join Date
    Apr 2000
    Posts
    1,175
    Hi !

    For that case it is better to use document.write for whole object and embed code. Or at least start writing from JS before printing <</object>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center