Open FLASHmx, create a document, set the document size to 260*120 on the attribute panel, right-click the first frame of the timeline, and select the action option in the shortcut menu, on the action panel, select EXPERT mode and enter the following code:
Stop ();
// Create a text field: Name showbox, depth 1, coordinate position 10, 10, width 200, Height 100
This. createTextField ("showbox", 10,200,100 );
// Set the background color to ffccff.
Showbox. background = true;
Showbox. backgroundColor = 0 xffccff;
// Set the multi-line feature of text and the initial usage value
Showbox. multiline = true;
Showbox. wordWrap = true;
Showbox. text = "the COOKIE on the current page is :";
// This object is used to receive data transmitted from javascript and monitor the attribute coo. When its value changes, the show function is automatically triggered.
Obj = {};
Obj. coo = "";
Obj. watch ("coo", show );
// This function is used to display cookies in the text box.
Function show (prop, oldval, newval ){
Showbox. text = showbox. text + newline + newval;
}
// Execute the Javascript script command. unescape is used to decompile cookies. If you do not need to display them on the page, remove them by yourself.
// The following line of statements does not automatically wrap. Note that
GetURL ("javascript: this.doc ument. getElementsByTagName ('object') [0]. SetVariable
('_ Root. obj. coo', unescape (document. cookie ))");
Test: Select release preview> html format from the File menu. Check: Yi, why didn't the cookie be displayed? Forgot to tell you that the site must have
Can the cookie be displayed? The simulation is as follows: select the release under the File menu, that is, html and swf are published [default settings].
Modify the published html file and add the following code for testing:
<Script language = "JavaScript" type = "text/JavaScript">
Document. cookie = "set cookie: Haha, your username is xyz ";
</Script>
Add the above Code to the head area, open the html file in a browser, and display:
If CORS is accessed, set: System. security. allowDomain (http://www.abc.net );