03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Example<br />

The following example adds a custom HTTP header named SOAPAction with a value of Foo<br />

to the my_lv object:<br />

my_lv.addRequestHeader("SOAPAction", "'Foo'");<br />

The following example creates an array named headers that contains two alternating HTTP<br />

headers <strong>and</strong> their associated values. The array is passed as an argument to<br />

addRequestHeader().<br />

var headers = ["Content-Type", "text/plain", "X-ClientAppVersion", "2.0"];<br />

my_lv.addRequestHeader(headers);<br />

The following example creates a new LoadVars object that adds a request header called<br />

FLASH-UUID. The header contains a variable that can be checked by the server.<br />

var my_lv:LoadVars = new LoadVars();<br />

my_lv.addRequestHeader("FLASH-UUID", "41472");<br />

my_lv.name = "Mort";<br />

my_lv.age = 26;<br />

my_lv.send("http://flash-mx.com/mm/cgivars.cfm", "_blank", "POST");<br />

See also<br />

addRequestHeader (XML.addRequestHeader method)<br />

contentType (LoadVars.contentType property)<br />

public contentType : String<br />

The MIME type that is sent to the server when you call LoadVars.send() or<br />

LoadVars.sendAndLoad(). The default is application/x-www-form-urlencoded.<br />

Example<br />

The following example creates a LoadVars object <strong>and</strong> displays the default content type of the<br />

data that is sent to the server.<br />

var my_lv:LoadVars = new LoadVars();<br />

trace(my_lv.contentType); // output: application/x-www-form-urlencoded<br />

See also<br />

send (LoadVars.send method), sendAndLoad (LoadVars.sendAndLoad method)<br />

decode (LoadVars.decode method)<br />

public decode(queryString:String) : Void<br />

Converts the variable string to properties of the specified LoadVars object.<br />

LoadVars 365

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!