﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- saved from url=(0014)about:internet -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="book" content="ActionScript&nbsp;3.0&nbsp;Language&nbsp;and&nbsp;Components&nbsp;Reference"><link rel="stylesheet" href="../../style.css" type="text/css" media="screen"><link rel="stylesheet" href="../../print.css" type="text/css" media="print"><link rel="stylesheet" href="../../override.css" type="text/css"><title>flash.net Details (ActionScript 3.0)</title></head><body><script language="javascript" type="text/javascript" src="../../asdoc.js"></script><script language="javascript" type="text/javascript" src="../../help.js"></script><script language="javascript" type="text/javascript" src="../../cookies.js"></script><script language="javascript" type="text/javascript">  
            <!--  
			    
				asdocTitle = 'flash.net package - ActionScript 3.0 Language and Components Reference';

				var baseRef = '../../';

				window.onload = configPage;
			      
			    -->  
            </script>
<script language="javascript" type="text/javascript"><!--
function submitValue(){
var searchStr=document.getElementById('search-livedocs').value;
window.location="../../search.html"+"###"+searchStr;
}
--></script><script type="text/javascript">
		scrollToNameAnchor();
	</script><table class="titleTable" cellpadding="0" cellspacing="0" id="titleTable" style="display:none"><tr><td class="titleTableTitle" align="left">ActionScript 3.0 Language and Components Reference</td><td class="titleTableSearch" align="center"><form class="searchForm" method="get" action="../../search.html" onsubmit="submitValue();"><input class="hidden" name="loc" value="" type="hidden"><input class="hidden" name="termPrefix" value="" type="hidden"><input class="hidden" name="term" value="" type="hidden"><input class="hidden" name="area" value="" type="hidden"><input id="search-livedocs" name="search_text" value="" title="" type="text"> <input type="button" name="action" value="Search" onclick="submitValue()"></form></td><td class="titleTableTopNav" align="right"><a href="../../../../Flash/10.0_Welcome/index.html">Home</a>&nbsp;|&nbsp;<a href="../../package-summary.html" onclick="loadClassListFrame('../../all-classes.html')">All Packages</a>&nbsp;|&nbsp;<a href="../../class-summary.html" onclick="loadClassListFrame('../../all-classes.html')">All Classes</a>&nbsp;|&nbsp;<a href="../../language-elements.html">Language Elements</a>&nbsp;| <a href="../../all-index-Symbols.html" onclick="loadClassListFrame('../../index-list.html')">Index</a>&nbsp;|&nbsp;<a href="../../appendixes.html">Appendixes</a>&nbsp;|&nbsp;<a href="../../conventions.html">Conventions</a>&nbsp;|&nbsp;<a id="framesLink1" href="../../index.html?flash/net/package.html&amp;flash/net/class-list.html">Frames</a><a id="noFramesLink1" style="display:none" href="" onclick="parent.location=document.location"> No Frames </a></td><td class="titleTableLogo" align="right" rowspan="3"><img src="../../images/logo.jpg" class="logoImage" alt=" Adobe Logo " title=" Adobe Logo "></td></tr><tr class="titleTableRow2"><td class="titleTableSubTitle" id="subTitle" align="left">Package</td><td class="titleTableSubNav" id="subNav" align="right" colspan="2"><a href="package.html#methodSummary">Functions</a></td></tr><tr class="titleTableRow3"><td colspan="3">&nbsp;</td></tr></table><script language="javascript" type="text/javascript" xml:space="preserve">
                
                    
                

				<!--

				
				    
				

					if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Package"); titleBar_setSubNav(false,false,false	,false,false,false,false,false,false	,false,true,false,false,false);}

				    
				        
				    
				-->
                
                    
                
			</script><div class="MainContent"><br><a name="methodSummary"></a>The flash.net package contains package-level functions for opening a new browser window, sending a URL request to a server, and dealing with class aliases.<div class="summarySection"><div class="summaryTableTitle">Public Methods </div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableMethod"><tr><th>&nbsp;</th><th colspan="2">Function</th><th>Defined By</th></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#getClassByAlias()" class="signatureLink">getClassByAlias</a>(aliasName:<a href="../../String.html">String</a>):<a href="../../Class.html">Class</a></div><div class="summaryTableDescription">Looks up a class that previously had an alias registered through a call to the registerClassAlias()
     method.</div></td><td class="summaryTableOwnerCol">flash.net</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#navigateToURL()" class="signatureLink">navigateToURL</a>(request:<a href="../../flash/net/URLRequest.html">URLRequest</a>, window:<a href="../../String.html">String</a> = null):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Opens or replaces a window in the application that contains the Flash Player container
     (usually a browser).</div></td><td class="summaryTableOwnerCol">flash.net</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#registerClassAlias()" class="signatureLink">registerClassAlias</a>(aliasName:<a href="../../String.html">String</a>, classObject:<a href="../../Class.html">Class</a>):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Preserves the class (type) of an object when the object is encoded in Action Message Format (AMF).</div></td><td class="summaryTableOwnerCol">flash.net</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#sendToURL()" class="signatureLink">sendToURL</a>(request:<a href="../../flash/net/URLRequest.html">URLRequest</a>):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Sends a URL request to a server, but ignores any response.</div></td><td class="summaryTableOwnerCol">flash.net</td></tr></table></div><a name="methodDetail"></a><div class="detailSectionHeader"> Function detail </div><a name="getClassByAlias()"></a><a name="getClassByAlias(String)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">getClassByAlias</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">function</td></tr></table><div class="detailBody"><code> public function getClassByAlias(aliasName:<a href="../../String.html">String</a>):<a href="../../Class.html">Class</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
        Looks up a class that previously had an alias registered through a call to the
        <code>registerClassAlias()</code>
        method.
        <p>
          This method does not interact with the
          <code>flash.utils.getDefinitionByName()</code>
          method.
        </p>
        
      </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">aliasName</span>:<a href="../../String.html">String</a></code> &mdash; The alias to find.</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../Class.html">Class</a></code> &mdash; The class associated with the given alias. If not found, an exception will be thrown.</td></tr></table><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../ReferenceError.html">ReferenceError</a> </code> &mdash; The alias was not registered.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="#registerClassAlias()" target="">registerClassAlias()</a></div></div><a name="navigateToURL()"></a><a name="navigateToURL(flash.net.URLRequest,String)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">navigateToURL</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">function</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function navigateToURL(request:<a href="../../flash/net/URLRequest.html">URLRequest</a>, window:<a href="../../String.html">String</a> = null):<a href="../../specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
        Opens or replaces a window in the application that contains the Flash Player container
     (usually a browser).
        <p>
          
          <b>
            <i>Important Security Note</i>
          </b>
          
        </p>
        
        <p>
          Developers often pass URL values to the
          <code>navigateToURL()</code>
          function that were obtained from external sources 
     such as FlashVars.  Attackers may try to manipulate these external sources to perform attacks such as cross-site scripting. 
     Therefore, developers should validate all URLs before passing them to this function.
        </p>
        
        <p>Good data validation for URLs can mean different things depending on the usage of the URL within the overall application.  
     The most common data validation techniques include validating that the URL is of the appropriate scheme.  
     For instance, unintentionally allowing javascript: URLs may result in cross-site scripting.  
     Validating that the URL is a within your domain can ensure that the SWF file can't be used as an open-redirector 
     by people who conduct phishing attacks.  For additional security, you may also choose to validate the path of the URL 
     and to validate that the URL conforms to the RFC guidelines</p>
        
        <p>For example, the following code shows a simple example of performing data validation by denying any URL 
     that does not begin with http:// or https:// and validating that the URL is within your domain name.  
     This example may not be appropriate for all web applications and you should consider whether additional checks 
     against the URL are necessary.</p>
        
        <div class="listing"><pre>// AS3 Regular expression pattern match for URLs that start with http:// and https:// plus your domain name.
     function checkProtocol (flashVarURL:String):Boolean {
        // Get the domain name for the SWF if it is not known at compile time.
        // If the domain is known at compile time, then the following two lines can be replaced with a hard coded string.
        var my_lc:LocalConnection = new LocalConnection();
        var domainName:String = my_lc.domain;
        // Build the RegEx to test the URL.
        // This RegEx assumes that there is at least one "/" after the
        // domain. http://www.mysite.com will not match.
        var pattern:RegExp = new RegExp("^http[s]?\:\\/\\/([^\\/]+)\\/");
        var result:Object = pattern.exec(flashVarURL);
        if (result == null || result[1] != domainName || flashVarURL.length &gt;= 4096) {
          return (false);
        }
        return (true);
     }</pre></div>
        
        <p>
          For
          <i>local</i>
          content running in a browser, calls to the
          <code>navigateToURL()</code>
          method that specify a
          <code>"javascript:"</code>
          pseudo-protocol 
     (via a
          <code>URLRequest</code>
          object passed as the first parameter) are only permitted if the SWF 
     file and the containing web page (if there is one) are in the local-trusted security sandbox.
     Some browsers do not support using the javascript protocol with the
          <code>navigateToURL()</code>
          method. Instead, consider using the
          <code>call()</code>
          method of the
          <code>ExternalInterface</code>
          API to invoke JavaScript methods within the enclosing HTML page.
        </p>
        
        <p>
          You cannot connect to commonly reserved ports. For a complete list of blocked
     ports, see "Restricting Networking APIs" in the 
     security chapter of the
          <i>Programming ActionScript 3.0</i>
          book.
        </p>
        
        <p>In Flash Player 10 and later running in a browser, using this method programmatically to
     open a pop-up window may not be successful.  Various browsers (and browser configurations) may block pop-up windows 
     at any time; it is not possible to guarantee any pop-up window will appear.  
     However, for the best chance of success, use this method to open a pop-up window only in code that executes 
     as a direct result of a user action (for example, in an event handler for a mouse click or key-press event.)</p>
        
        <p>In Flash Player 10 and later, if you use a multipart Content-Type (for example "multipart/form-data") 
     that contains an upload (indicated by a "filename" parameter in a "content-disposition" header within the POST body),
  the POST operation is subject to the security rules applied to uploads:</p>
        
        <ul><li>The POST operation must be performed in response to a user-initiated action, such as a mouse click or key press.</li><li>If the POST operation is cross-domain (the POST target is not on the same server as the SWF file 
  that is sending the POST request),
  the target server must provide a URL policy file that permits cross-domain access.</li></ul>
        
        <p>Also, for any multipart Content-Type, the syntax must be valid (according to the RFC2046 standards).
     If the syntax appears to be invalid, the POST operation is subject to the security rules applied to uploads.</p>
        
        <p>For more information related to security, see the following:</p>
        
        <ul><li>
            The
            <a href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" target="external">security chapter</a>
            in the
            <i>Programming ActionScript 3.0</i>
            book and the latest comments on LiveDocs
          </li><li>
            The Flash Player Developer Center Topic:
            <a href="http://www.adobe.com/go/devnet_security_en" target="external">Security</a>
          </li></ul>
        
      </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">request</span>:<a href="../../flash/net/URLRequest.html">URLRequest</a></code> &mdash; 
            A URLRequest object that specifies the URL to navigate to.
            <p>
              <span>For content running in Adobe AIR, when</span>
              
              using the
              <code>navigateToURL()</code>
              function, the runtime treats a URLRequest that uses the POST
     method (one that has its
              <code>method</code>
              property set to
              <code>URLRequestMethod.POST</code>
              )
     as using the GET method.
            </p>
            
          </td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">window</span>:<a href="../../String.html">String</a></code> (default = <code>null</code>)<code></code> &mdash; 
            The browser window or HTML frame in which to display
                   the document indicated by the
            <code>request</code>
            parameter.
     You can enter the name of a specific window or use one of the following values:
            <ul><li>
                <code>"_self"</code>
                specifies the current frame in the current window.
              </li><li>
                <code>"_blank"</code>
                specifies a new window.
              </li><li>
                <code>"_parent"</code>
                specifies the parent of the current frame.
              </li><li>
                <code>"_top"</code>
                specifies the top-level frame in the current window.
              </li></ul>
            
            <p>
              If you do not specify a value for this parameter, a new empty window is created.
     In the stand-alone player, you can either specify a new (
              <code>"_blank"</code>
              ) window
     or a named window. The other values don't apply.
            </p>
            
            <p>
              <b>Note:</b>
              When code in a SWF file that is running in the 
     local-with-filesystem sandbox calls the
              <code>navigateToURL()</code>
              function and specifies a custom window name for the
              <code>window</code>
              parameter, the window name is transfered into a random name. The name is in 
     the form
              <code>"_flashXXXXXXXX"</code>
              , where each X represents a random 
     hexadecimal digit. Within the same session (until you close the containing 
     browser window), if you call the function again and specify the same name for 
     the
              <code>window</code>
              parameter, the same random string is used.
            </p>
            
          </td></tr></table></p><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../flash/errors/IOError.html">IOError</a> </code> &mdash; 
            The
            <code>digest</code>
            property of the
            <code>request</code>
            object is not
            <code>null</code>
            . You should only set the
            <code>digest</code>
            property of a URLRequest object
     for use calling the
            <code>URLLoader.load()</code>
            method when loading a SWZ file (an Adobe 
     platform component).
          </td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20"></td><td><code><a href="../../SecurityError.html">SecurityError</a> </code> &mdash; 
            This error is thrown in the following situations:
            <ul><li>Local untrusted SWF files may not communicate with
     the Internet. You can avoid this situation by reclassifying this SWF file
     as local-with-networking or trusted.</li><li>
                A navigate operation attempted to evaluate a scripting
     pseudo-URL, but the containing document (usually an HTML document in a
     browser) is from a sandbox to which you do not have access.  You can avoid this situation 
     by specifying
                <code>allowScriptAccess="always"</code>
                in the containing
     document.
              </li><li>
                You cannot navigate the special windows
                <code>"_self"</code>
                ,
                <code>"_top"</code>
                , or
                <code>"_parent"</code>
                if your SWF file is contained by an HTML page
     that has set the
                <code>allowScriptAccess</code>
                to
                <code>"none"</code>
                , or to
                <code>"sameDomain"</code>
                when the domains of the HTML file and the SWF file do not match.
              </li><li>You cannot navigate a window with a nondefault name
     from within a SWF file that is in the local-with-filesystem sandbox.</li><li>
                You cannot connect to commonly reserved ports. For a complete list of blocked
     ports, see "Restricting Networking APIs" in the 
     security chapter of the
                <i>Programming ActionScript 3.0</i>
                book.
              </li></ul>
            
          </td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20"></td><td><code><a href="../../Error.html">Error</a> </code> &mdash; If the method is not called in response to a user action, such as a mouse
     event or keypress event.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="../../flash/external/ExternalInterface.html#call()" target="">flash.external.ExternalInterface.call()</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
        The following example opens the URL http://www.adobe.com in a new browser window and passes data about a
 user session, captured in a URLVariables object, to the web server.
        <div class="listing"><pre>package {
    import flash.display.Sprite;
    import flash.net.navigateToURL;
    import flash.net.URLRequest;
    import flash.net.URLVariables;

    public class NavigateToURLExample extends Sprite {

        public function NavigateToURLExample() {
            var url:String = "http://www.adobe.com";
            var variables:URLVariables = new URLVariables();
            variables.exampleSessionId = new Date().getTime();
            variables.exampleUserLabel = "Your Name";
            var request:URLRequest = new URLRequest(url);
            request.data = variables;
            try {            
                navigateToURL(request);
            }
            catch (e:Error) {
                // handle error here
            }
        }
    }
}</pre></div>
      </div></div><a name="registerClassAlias()"></a><a name="registerClassAlias(String,Class)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">registerClassAlias</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">function</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function registerClassAlias(aliasName:<a href="../../String.html">String</a>, classObject:<a href="../../Class.html">Class</a>):<a href="../../specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
        Preserves the class (type) of an object when the object is encoded in Action Message Format (AMF).
     When you encode an object into AMF, this function saves the alias for its class, so that you can 
     recover the class when decoding the object.
     If the encoding context did not register an alias for an object's class, the object
     is encoded as an anonymous object. Similarly, if the decoding context does not have the same
     alias registered, an anonymous object is created for the decoded data.
        <p>LocalConnection, ByteArray, SharedObject, NetConnection and NetStream are all examples
     of classes that encode objects in AMF.</p>
        
        <p>The encoding and decoding contexts do not need to use the same class for an alias;
     they can intentionally change classes, provided that the destination class contains all of the members
     that the source class serializes.</p>
        
      </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">aliasName</span>:<a href="../../String.html">String</a></code> &mdash; The alias to use.</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">classObject</span>:<a href="../../Class.html">Class</a></code> &mdash; The class associated with the given alias.</td></tr></table></p><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../TypeError.html">TypeError</a> </code> &mdash; 
            If either parameter is
            <code>null</code>
            .
          </td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="ObjectEncoding.html" target="">ObjectEncoding class</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
        This example uses the
        <code>registerClassAlias()</code>
        function to register
 an alias (
        <code>com.example.eg</code>
        ) for the class ExampleClass. Because
 an alias is registered for the class, the object is able to be deserialized as an instance
 of ExampleClass, and the code outputs
        <code>true</code>
        . If the
        <code>registerClassAlias()</code>
        call were removed, the code would output
        <code>false</code>
        .
        <div class="listing"><pre>package {
    import flash.display.Sprite;
    import flash.net.registerClassAlias;
    import flash.utils.ByteArray;

    public class RegisterClassAliasExample extends Sprite {
        public function RegisterClassAliasExample() {
            registerClassAlias("com.example.eg", ExampleClass);
            var eg1:ExampleClass = new ExampleClass();
            var ba:ByteArray = new ByteArray();
            ba.writeObject(eg1);
            ba.position = 0;
            var eg2:* = ba.readObject();
            trace(eg2 is ExampleClass); // true
        }
    }
}

class ExampleClass {}</pre></div>
      </div></div><a name="sendToURL()"></a><a name="sendToURL(flash.net.URLRequest)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">sendToURL</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">function</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function sendToURL(request:<a href="../../flash/net/URLRequest.html">URLRequest</a>):<a href="../../specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
        Sends a URL request to a server, but ignores any response.
        <p>
          To examine the server response, use the
          <code>URLLoader.load()</code>
          method instead.
        </p>
        
        <p>
          You cannot connect to commonly reserved ports. For a complete list of blocked
     ports, see "Restricting Networking APIs" in the 
     security chapter of the
          <i>Programming ActionScript 3.0</i>
          book.
        </p>
        
        <p>
          You can prevent a SWF file from using this method by setting the
          <code>allowNetworking</code>
          parameter of the the
          <code>object</code>
          and
          <code>embed</code>
          tags in the HTML page that contains the SWF content.
        </p>
        
        <p>In Flash Player 10 and later, if you use a multipart Content-Type (for example "multipart/form-data") 
     that contains an upload (indicated by a "filename" parameter in a "content-disposition" header within the POST body),
  the POST operation is subject to the security rules applied to uploads:</p>
        
        <ul><li>The POST operation must be performed in response to a user-initiated action, such as a mouse click or key press.</li><li>If the POST operation is cross-domain (the POST target is not on the same server as the SWF file 
  that is sending the POST request),
  the target server must provide a URL policy file that permits cross-domain access.</li></ul>
        
        <p>Also, for any multipart Content-Type, the syntax must be valid (according to the RFC2046 standards).
     If the syntax appears to be invalid, the POST operation is subject to the security rules applied to uploads.</p>
        
        <p>For more information related to security, see the following:</p>
        
        <ul><li>
            The
            <a href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" target="external">security chapter</a>
            in the
            <i>Programming ActionScript 3.0</i>
            book and the latest comments on LiveDocs
          </li><li>
            The Flash Player Developer Center Topic:
            <a href="http://www.adobe.com/go/devnet_security_en" target="external">Security</a>
          </li></ul>
        
      </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">request</span>:<a href="../../flash/net/URLRequest.html">URLRequest</a></code> &mdash; A URLRequest object specifying the URL to send data to.</td></tr></table></p><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../SecurityError.html">SecurityError</a> </code> &mdash; Local untrusted SWF files cannot communicate with
     the Internet. You can avoid this situation by reclassifying this SWF file
     as local-with-networking or trusted.</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20"></td><td><code><a href="../../SecurityError.html">SecurityError</a> </code> &mdash; 
            You cannot connect to commonly reserved ports. For a complete list of blocked
     ports, see "Restricting Networking APIs" in the 
     security chapter of the
            <i>Programming ActionScript 3.0</i>
            book.
          </td></tr></table><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
        The following example passes data about a
 user session, captured in a URLVariables object, to the application at http://www.yourDomain.com/application.jsp.
        <div class="listing"><pre>package {
    import flash.display.Sprite;
    import flash.net.URLRequest;
    import flash.net.URLVariables;
    import flash.net.sendToURL;

    public class SendToURLExample extends Sprite {

        public function SendToURLExample() {
            var url:String = "http://www.yourDomain.com/application.jsp";
            var variables:URLVariables = new URLVariables();
            variables.sessionId = new Date().getTime();
            variables.userLabel = "Your Name";

            var request:URLRequest = new URLRequest(url);
            request.data = variables;
            trace("sendToURL: " + request.url + "?" + request.data);
            try {
                sendToURL(request);
            }
            catch (e:Error) {
                // handle error here
            }
        }
    }
}</pre></div>
      </div></div><p></p><center class="copyright"> &copy; 2004-2008 Adobe Systems Incorporated. All rights reserved. <br/>Thu Oct 30 2008, 07:14 PM -07:00  </center><div style="display:none">flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net flash.net </div></div></body></html>
