interaction | scripting | browser
1. Geturl send information to the browser
Format: GetURL ("Address", "Receive Window", "mode")
Example:
Build a TEST.FLA document, the first frame
Build three button (BTU1,BTU2,BTU3)
Build a TextInput (INPUT1)
As script:
function Opensite () {
This.geturl ("http://www.macromedia.com", "_self");
}
var str:string;
function Passva () {
str = This.input1.text;
This.geturl ("http://localhost/test.asp", "_blank", "get");
}
function Increase () {
This.geturl ("Javascript:alert (' Say hello! ')");
}
Btu1.addeventlistener ("Click", Mx.utils.Delegate.create (this, opensite));
Btu2.addeventlistener ("Click", Mx.utils.Delegate.create (this, passva));
Btu3.addeventlistener ("Click", Mx.utils.Delegate.create (this, increase));
Build the document test.asp on the IIS WEB server and add the following statement:
<form name= "Form1" method= "Post" action= "" >
<input type= "text" name= "TextField" value=<%=request.querystring ("str")%>>
</form>
FLA Routines: Click to download source files
1. Loadvariables class
GetURL can only send data to the script, not receive the script, and loadvariables .
Example
ASP script , codepage= "65001" is to enable the script to support Unicode, the document is placed under the IIS WEB SERVER root directory: <%@ Language= "JAVASCRIPT" codepage= "65001"%>
<%
Restr= "Hi," +request.form ("str")
Response.Write ("Rebackdata=" +restr)
%>
<% @LANGUAGE = "JAVASCRIPT" codepage= "65001"%>
<%
Restr= "Hi," +request.form ("str")
Response.Write ("Rebackdata=" +restr)
%>
Flash Movie, create a MC(mc1_int) in the scene, with a component Button (BTU1) and a Label (Label1) .
The first frame of the scene as
function Recievedara () {
This.loadvariables ("http://localhost/pass.asp", "POST");
}
_root.mc1_int.btu1.addeventlistener ("Click", Mx.utils.Delegate.create (_root.mc1_int, Recievedara));
Instance mc1_int as :
Onclipevent (data) {
_root.mc1_int.label1.text = Rebackdata.tostring ();
}
Instance mc1_int component as , variable str is the content to be sent to the ASP script
var str = This.label1.text; Routines Click here to download the file