asp section:
<%
Added=request ("added")
Del=request ("del")
Action=request. QueryString ("Action")
Set Conn=server.createobject ("Adodb.connection")
Set Rs=server.createobject (" Adodb.recordset ")
Dbpath=server. MapPath ("Db1.mdb")
connstr= driver={microsoft Access Driver (*.mdb)};d bq= "&dbpath
Conn. The Open connstr
if (Action <> "add" and action <> "added") then
' reads the database Information section
sql= ' select * from Shu where id=1 "
Rs.Open sql,conn,1,1
If rs.eof and Rs.bof then
else
Response.Write" A= "& (RS (" number ")) Response. Write "&eof=true"
End If
End If
%>
<%
' section below for delete-by-button Information Section
if (action= "add") then
sql= "SEL" ECT * from Shu where id=1 "
Rs. Open sql,conn,1,3
RS ("number") =del
Rs.update
Response.Write "Ok=1"
Rs.close
End If
%>
<%
' The section below is to save the Press Twist Information Section
if (action= "added") then
sql= "select * from Shu where id=1"
Rs. Open sql,conn,1,3
RS ("number") =added
RS. Update
Response.Write "save=1"
Rs.close
End If
%>
Flash section:
The first part is initializing variables:
EOF = false;
A=0//The initial number of buttons
R = Random (65500);
Loadvariables ("Read.asp? Action= "Add R," "");//Add random number to prevent different browsers from not being able to refresh variables (but may be superfluous, haha) 9th Ching:
if (eof ne "true") {
gotoAndPlay ("read");
} The
determines whether the data is read successfully!
Tenth Jeong:
A = number (a);
if (a = = 0 or a<0) {
A = 1;
for (i=1; i<=a; i++) {
_root.attachmovie ("M "+i," M "+i, i+1);
if (i<=5) {
eval ("M" +i). _x = 200+i*eval ("M" +i). _width;
Eval ("M" +i). _y =;
}
if (i>5 and i<=10) {
eval ("M" +i). _x = I*eval ("M" +i). _width-50;
Eval ("M" +i). _y =;
}
}
Else {
for (i=1; i<=a; i++) {
_root.attachmovie ("M" +i, "M" +i, i+1);
if (i<=5) {
eval ("M "+i). _x = 200+i*eval (" M "+i). _width;
Eval ("M" +i). _y = 200;
}
if (I>5 and i<=10) {
eval ("M" +i). _x = I*eval ("M" +i). _width-50;
Eval ("M" +i). _y =;
}
}
}
Stop ();
//To add a button based on the size of the number "a" in the database, sorted in 5*2 order! Load button:
on (release) {
if (a< =10 and A>=1) {
A =number (a) +1;
Trace (a);
_root.attachmovie ("M" +a, "M" +a, a+1);
if (a<=5) {
Eva L ("M" +a). _x = 200+a*eval ("M" +a). _width;
Eval ("M" +a). _y = 200;
}
if (A>5 and a<=10) {
eval ("M" +a). _x = A*eval ("M" +a). _width-50;
Eval ("M" +a). _y =;
}
}
if (a>10) {
_root.aa.attachmovie ("wrong", "wrong", 1000);
This.wrong._width =;
This.wrong._ Height = 400;
This.wrong._x = 225;
This.wrong._y = 200;
a=10
}
}
is pressed at the secondary load based on the number of a (only flash internal loading is used here), and if the number of extra buttons exceeds 10, the load is stopped and a warning appears! Delete the button part:
on (release) {
del = A-1
Loadvariables ("Read.asp?action=add", "", "POST");
for (i=1;i<=a;i++) {
Removemovieclip (eval ("M" +i));
gotoAndPlay ("Do_del");
}
Determine the value of a after deletion and send it to a asp! However, there is a need to clean up the number of flash internal a, to prevent flash internal no refresh caused by a reduction in the number of a, but by the number of cattle did not reduce the situation! Save the button part:
On (release) {
Added = A;
for (i=1;i<=a;i++) {
Removemovieclip (eval ("M" +i));
}
Loadvariables ("read.asp?action=added", "", "POST");
gotoAndPlay ("Do_save");
}//the value of a to the ASP and then saved to the database, which also emptied the flash internal A, the reason for the above!