Pass Variables From Flash to HTML

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:

flash html code image1


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:

flash html code image2

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.

No comments: