website promotion banner
Free Stock Images
  • Create A Free Account
  • Download High-Res Stock Images For Free
  • +5 Million Images
Your Ad Here
Flash & Swish  Home Flash & Swish Flash Tutorials Transferring Parameters from HTML to Flash (Exclusive Tutorial)
rss

Transferring Parameters from HTML to Flash (Exclusive Tutorial)

Author: Val More by this author


Until recently the most well-known and widely-used method for transferring variables of a Flash movie from HTML-view, was the addition of the segments to the URL of .swf-document, as shown below:

<OBJECT ...
<PARAM NAME=movie VALUE="flash.swf ?var1=value1&var2=value2&...&varN=valueN ">
...
<EMBED src="flash.swf ?var1=value1&var2=value2&...&varN=valueN "
...
</EMBED></OBJECT>
(using files test.fla, test.html with this method)

Essentially, this is nothing other than the GET method, so it does not allow "hooking on" more than 256 symbols to the address line, and in other words – the transference in a clip of a large quantity of variables or their long line values. But this is not its main disadvantage, since in most cases of these parameters, the length of the query is absolutely sufficient. The basic disadvantage of this method is that when changing the lines of parameters, a Flash clip once again downloads from the server to the client's computer and if its size is sufficiently big, then during every change to a new HTML-page, it is necessary to wait for the page to reload – losing all meaning of using this method.

In Flash-Player's 6 th version, a new parameter, called FlashVars, has appeared, which facilitates sending Flash-clip variables from their HTML-view. The method of using it is shown below:

<OBJECT ...
<PARAM NAME=movie VALUE="flash.swf">
<PARAM NAME= FlashVars VALUE="var1=value1&var2=value2&...&varN=valueN">
...
<EMBED src="flash.swf"
FlashVars ="var1=value1&var2=value2&...&varN=valueN"
...
</EMBED></OBJECT>
(using files test2.fla, test2.html adapted with this method)

Variables are given in the root ( _root ) foundation of a Flash-clip ( _level0 ).

Advantages: This method of sending variables of a Flash clip converted to HTML-view removes the limitations and disadvantages of the GET method.


Rate this Material: Bad 1 2 3 4 5 Excellent
print this page tell a friend subscribe to newsletter subscribe to rss

Add comments to "Transferring Parameters from HTML to Flash (Exclusive Tutorial)"