A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: how to pass variables to a swf by the <param name="movie...

  1. #1
    Member
    Join Date
    May 2002
    Posts
    39

    how to pass variables to a swf by the <param name="movie...

    In a tutorial i've read that we can pass variables from a html link (like "http://mysite/mypage.html?var1=hello") to a swf by using the following syntax :

    <param name="movie" value="url.swf' + document.location.search + '">

    Now, if the variable doesn't come from a link but it is known, what is the syntax following the value="url.swf... ?

    thanks a lot

  2. #2
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    If the variable is created from within the page with the movie you can use

    document.write('<param name="movie" value="filename.swf?variableName=' + variableValue + '">');

    and to pass the variable in the embed tag

    document.write('<embed src="filename.swf?variableName=' + variableValue + '"... other embed parameters here ... ');

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