2007年5月7日星期一

URLRequest for URL Strings

Methods relying on URL strings in ActionScript 3 now use URLRequest (flash.net.URLRequest) instances instead of direct string values for URLs. URLRequest instances contain the following properties:
• contentType:String
• data:Object
• method:String
• requestHeaders:Array
• url:String
which relates to the URL itself (specified in the url property).

For example, when using navigateToURL() (flash.net.navigateToURL) (getURL() replacement), instead of passing a string of the URL to navigate to, you use a URLRequest instance.
ActionScript Code:
var request:URLRequest = new URLRequest("http://www.adobe.com/");
navigateToURL(request);

0 评论: