分享
 
 
 

组件+PHP+MYSQL的新闻发布系统

王朝mysql·作者佚名  2008-05-19
窄屏简体版  字體: |||超大  

var x:Number = 60;

var y:Number = 30;

System.useCodepage = true;

function inposition(myobject:Object, mylabelname:String, x0:Number, y0:Number):Void {

//返回标签的位置和标志

myobject.text = mylabelname;

myobject.move(x0, y0);

return;

}

function checkin(my_txt:Object):Boolean {

//检测输入文本是否为空

if (my_txt.text == "") {

trace(my_txt._name+"_empty");

return false;

} else {

trace(my_txt._name+"_nonempty");

return true;

}

}

function clearin(my_txt) {

//清空输入文本

my_txt.text = "";

}

function adddone() {

//当数据写入完毕就显示开始的状态

_level0.myaa.addmynews.mesin._visible = 1;

//trace(myaa.addmynews.mesin._visible);

myaa.addmynews.clear1._visible = 1;

myaa.addmynews.sure1._visible = 1;

}

function loginnow() {

//登陆后的状态

trace("back");

//var back = myaa.inlogin.createChild("Button", "b1", {label:"返回"});

//back.move(x+120, y+60);

//back.setSize(50, 20);*/

clearbtn.label = "返回";

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:"确定"});

surebtn1.setSize(50, 20);

surebtn1.move(150, 210);

var clearbtn1 = myaa.addmynews.createChild("Button", "clear1", {label:"清除"});

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 == "确定") {

trace("add now");

messages_txt._visible = 0;

clearbtn1._visible = 0;

surebtn1._visible = 0;

loadadd("addnews", messages_txt.text);

} else if (nowlabel == "清除") {

clearin(messages_txt);

//testa.removeMovieClip();

trace("clear");

}

};

surebtn1.addEventListener("click", addform);

clearbtn1.addEventListener("click", addform);

}

function loginout() {

//退出后的状态,返回原来的

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 = "清除";

myloading.text = "";

myaa.destroyChildAt(myaa.numChildren-1);

}

var root = this;

addphp = new LoadVars();

function loadadd(url:String, mes:String) {

//写入的数据

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");

//检验登陆

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:"登陆"});

surebtn.setSize(50, 20);

surebtn.move(x+60, y+60);

var clearbtn = myaa.inlogin.createChild("Button", "clear", {label:"清除"});

clearbtn.setSize(50, 20);

clearbtn.move(x+120, y+60);

var loginform:Object = new Object();

myaa.selectedIndex = 1;

loginform.click = function(eventObj) {

//从标签来取的动作

var nowlabel = (eventObj.target.label);

trace(nowlabel);

if (nowlabel == "登陆") {

if (checkin(inmyname) && checkin(inmypass)) {

trace("Load php now");

loadphp("checkmeb", inmyname.text, inmypass.text);

}

} else if (nowlabel == "清除") {

clearin(inmyname);

clearin(inmypass);

//testa.removeMovieClip();

trace("clear");

} else if (nowlabel == "返回") {

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) {

//载入新闻的内容

//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);

///////////////////////我这里没做太多的解释了,因为组件的应用都是在自带的帮助可以找到的。//////////////////

里面有了MYSQL了。。。

你用phpMyAdmin运行就可以了。

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有