Component +php+mysql News Release System

Source: Internet
Author: User
Tags empty mysql mysql in
mysql var x:number = 60;
var y:number = 30;
System.usecodepage = true;
function Inposition (Myobject:object, mylabelname:string, X0:number, Y0:number): Void {
Returns the label's position and flag
Myobject.text = Mylabelname;
Myobject.move (x0, y0);
Return
}
function Checkin (my_txt:object): Boolean {
Detects if the input text is empty
if (My_txt.text = = "") {
Trace (my_txt._name+ "_empty");
return false;
} else {
Trace (my_txt._name+ "_nonempty");
return true;
}
}
function Clearin (my_txt) {
Empty input text
My_txt.text = "";
}
function Adddone () {
Shows the starting state when the data is written
_level0.myaa.addmynews.mesin._visible = 1;
Trace (myaa.addmynews.mesin._visible);
myaa.addmynews.clear1._visible = 1;
myaa.addmynews.sure1._visible = 1;
}
function Loginnow () {
Status after the landing
Trace ("Back");
var back = myaa.inlogin.createChild ("button", "B1", {label: "return"});
Back.move (x+120, y+60);
Back.setsize (50, 20);
Clearbtn.label = "return";
surebtn._visible = 0;
mynamelabel._visible = 0;
mypasslabel._visible = 0;
inmyname._visible = 0;
inmypass._visible = 0;
var newsadd = myaa.createchild ("View", "Addmynews", {label: ".: ADD news:."});
var messages_txt = myaa.addmynews.createChild ("TextInput", "Mesin");
Trace (typeof (Inmyname.text));
var messign = myaa.addmynews.createChild ("Label", "messigns");
Messages_txt.wordwrap = true;
Inposition (messign, "News", 25, 0);
Messages_txt.move (25, 20);
Messages_txt.text = "Your News";
Messages_txt.setsize (250, 180);
var surebtn1 = myaa.addmynews.createChild ("button", "Sure1", {label: "OK"});
Surebtn1.setsize (50, 20);
Surebtn1.move (150, 210);
var clearbtn1 = myaa.addmynews.createChild ("button", "Clear1", {label: "clear"});
Clearbtn1.setsize (50, 20);
Clearbtn1.move (220, 210);
var addform = new Object ();
Addform.click = function (EVENTOBJ) {
var Nowlabel = (EventObj.target.label);
Trace (Nowlabel);
if (Nowlabel = = "OK") {
Trace ("Add Now");
messages_txt._visible = 0;
clearbtn1._visible = 0;
surebtn1._visible = 0;
Loadadd ("Addnews", Messages_txt.text);
else if (Nowlabel = "clear") {
Clearin (Messages_txt);
Testa.removemovieclip ();
Trace ("clear");
}
};
Surebtn1.addeventlistener ("click", AddForm);
Clearbtn1.addeventlistener ("click", AddForm);
}
function Loginout () {
After exiting the state, return the original
Myloading.move (0, 0);
inmyname._visible = 1;
inmypass._visible = 1;
Inmyname.text = "";
Inmypass.text = "";
surebtn._visible = 1;
mynamelabel._visible = 1;
mypasslabel._visible = 1;
Clearbtn.label = "clear";
Myloading.text = "";
Myaa.destroychildat (myaa.numchildren-1);
}
var root = this;
addphp = new Loadvars ();
function Loadadd (url:string, mes:string) {
The data written
var loading1 = myaa.addmynews.createChild ("Label", "loadings");
Loading1.autosize = true;
Trace (LOADING1);
Inposition (loading1, "loading\nplease wait ...", 115, 90);
Addphp.messages = mes;
Loginnow ();
Addphp.onload = function (success) {
if (success) {
Addphp.messages = mes;
Adddone ();
Loading1.text = "";
Trace ("Done");
} else {
Trace ("no");
Testa = Myaa.inlogin.createChild ("button", "Test", {LABEL:MYPHP.NAME0});
}
};
Addphp.sendandload (url+ ". php", addphp, "POST");
//
}
myphp = new Loadvars ();
function loadphp (url:string, myname0:string, mypass0:string) {
Myloading.text = "Loading data ...";
Loginnow ();
Myphp.onload = function (success) {
if (success) {
Myloading.text = "";
Trace ("Load done");
Inspection Landing
if (MYNAME0 = = MYPHP.NAME0 && Mypass0 = = myphp.passwords) {
Trace ("OK");
Loginnow ();
Myloading.move (70, 50);
Myloading.text = "Welcome" +MYPHP.NAME0;
Testa = Myaa.inlogin.createChild ("button", "clear", {label: "Fit"});
} else {
Inmyname.text = "";
Inmypass.text = "";
Trace ("no");
Testa = Myaa.inlogin.createChild ("button", "Test", {LABEL:MYPHP.NAME0});
}
}
};
Myphp.sendandload (url+ ". php", myphp, "POST");
//
}
var root = this;
Myaa.createchild ("View", "Innew", {label: ".: News:."});
Myaa.createchild ("View", "Inlogin", {label: ".: Login:."});
Myaa.createchild ("View", "coming", {label: ".: Coming soon:."});
var Mynamelabel = myaa.inlogin.createChild ("Label", "myname");
Inposition (Mynamelabel, "Name:", x, y);
var myloading = myaa.inlogin.createChild ("Label", "Loading");
Myloading.autosize = true;
Myloading.text = "";
var Mypasslabel = myaa.inlogin.createChild ("Label", "Mypass");
Inposition (Mypasslabel, "Password:", x, y+32);
var copyright = Myaa.inlogin.createChild ("Label", "copy");
Copyright.autosize = true;
Copyright.move (75, 200);
Copyright.text = "Copyright?" shuhankuang\n all Rights Reserved ";
var inmyname = myaa.inlogin.createChild ("TextInput", "Namein");
Trace (typeof (Inmyname.text));
Inmyname.move (x+65, y);
var inmypass = myaa.inlogin.createChild ("TextInput", "Passin");
Inmypass.password = true;
Inmypass.move (x+65, y+30);
var surebtn = myaa.inlogin.createChild ("button", "sure", {label: "Login"});
Surebtn.setsize (50, 20);
Surebtn.move (x+60, y+60);
var clearbtn = myaa.inlogin.createChild ("button", "clear", {label: "Purge"});
Clearbtn.setsize (50, 20);
Clearbtn.move (x+120, y+60);
var loginform:object = new Object ();
Myaa.selectedindex = 1;
Loginform.click = function (EVENTOBJ) {
The action to take from the label
var Nowlabel = (EventObj.target.label);
Trace (Nowlabel);
if (Nowlabel = "Login") {
if (Checkin (inmyname) && checkin (Inmypass)) {
Trace ("Load php Now");
loadphp ("Checkmeb", Inmyname.text, Inmypass.text);
}
else if (Nowlabel = "clear") {
Clearin (Inmyname);
Clearin (Inmypass);
Testa.removemovieclip ();
Trace ("clear");
else if (Nowlabel = "Back") {
Loginout ();
}
};
Surebtn.addeventlistener ("click", LoginForm);
Clearbtn.addeventlistener ("click", LoginForm);
news////////
var newinfo = myaa.innew.createChild ("TextArea", "Newarea");
Newinfo.move (2, 2);
Newinfo.hscrollpolicy = "Off";
Newinfo.wordwrap = true;
Newinfo.editable = false;
Newinfo.backgroundcolor = 0x123456;
Newinfo.multiline = true;
Newinfo.setsize (294, 250);
var mynewsinfo = new Loadvars ();
Loadnews ("show");
function Loadnews (url:string) {
The contents of the news
Trace (1111111111)
Mynewsinfo.onload = function (success) {
if (success) {
Newinfo.text = mynewsinfo.messages;
}
};
Mynewsinfo.load (url+ ". php?") +random (99999), Mynewsinfo, "POST");
//
}
Myaachage = new Object ();
Myaachage.change = function (EVENTOBJ) {
if (EventObj.target.selectedIndex = = 0) {
Loadnews ("show");
}
};
Myaa.addeventlistener ("Change", myaachage);
I don't have a lot of explanations here, because the components are used in their own help to find. //////////////////

There's MySQL in it ...
You can run it with a phpmyadmin.

[Download original file]



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.