Remember, you need to make the same changes to both the
to maintain consistency between all browsers. You might notice that the words are
separated by + punctuators. The words are separated this way because the values are URL-
encoded and the + punctuator represents a single blank space.
For a list of common URL-encoded special characters, see the Flash TechNote,
URL Encoding: Reading special characters from a text
Because the ampersand (
you are passing contain ampersands, unexpected results might occur. Given the nature of
name/value pairs and parsing, if you had the following values being passed to Flash:
my.swf?name=Ben+&+Jerry&flavor=Half+Baked
Flash would build the following variables (and values) into the root scope:
'name': 'Ben ' (note space at end of value)
' Jerry': '' (note space at beginning of variable name and an empty
value)
'flavor': 'Half Baked'
To avoid this, you need to escape the ampersand (
its URL-encoded equivalent (
8.
Open the urlvariables.html document, and find the following code:
?myURL=http://weblogs.macromedia.com&myTitle=Macromedia+News+Aggregator
Replace it with the following code:
?myURL=Ben+%26+Jerry&flavor=Half+Baked
9.
Save the revised HTML, and test your Flash document again.
You see that Flash created the following name/value pairs.
'name': 'Ben & Jerry'
'flavor': 'Half Baked'
All browsers will support string sizes as large as 64K (65535 bytes) in length.
FlashVars must be assigned in both the object and embed tags in order to work on
all browsers.
) serves as a delimiter for different name/value pairs, if the values
&
).
%26
tag and the
object
file.
character in the name/value pair with
&)
About variables
tag
embed
103
Need help?
Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?