php新闻发布组件,×é¼þ+PHP+MYSQLµÄÐÂÎÅ·¢²¼ÏµÍ³

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

///ÎÒÕâÀïû×öÌ«¶àµÄ½âÊÍÁË£¬ÒòΪ×é¼þµÄÓ¦Óö¼ÊÇÔÚ×Ô´øµÄ°ïÖú¿ÉÒÔÕÒµ½µÄ¡£//

/************************************************************************************** * Ö±Á÷µç»úʵÑé * ʵÏÖÏÖÏó£ºÏÂÔسÌÐòºó£¬°´ÕÕ¹âÅÌÄÚ²Ù×÷ÊÓƵ½ÓÏߣ¬Ö±Á÷µç»úÐýת´óÔ¼5S£¬È»ºóÍ£Ö¹ ×¢ÒâÊÂÏÎÞ ***************************************************************************************/ #include "reg52.h" //´ËÎļþÖж¨ÒåÁ˵¥Æ¬»úµÄÒ»ÐÌØÊ⹦ÄܼĴæÆ÷ #include<intrins.h> //ÒòΪҪÓõ½×óÓÒÒƺ¯Êý£¬ËùÒÔ¼ÓÈëÕâ¸öÍ·Îļþ typedef unsigned int u16; //¶ÔÊý¾ÝÀàÐͽøÐÐÉùÃ÷¶¨Òå typedef unsigned char u8; sbit moto=P1^0; /******************************************************************************* * º¯ Êý Ãû : delay * º¯Êý¹¦ÄÜ : ÑÓʱº¯Êý£¬i=1ʱ£¬´óÔ¼ÑÓʱ10us *******************************************************************************/ void delay(u16 i) { while(i--); } /******************************************************************************* * º¯ Êý Ãû : main * º¯Êý¹¦ÄÜ : Ö÷º¯Êý * Êä Èë : ÎÞ * Êä ³ö : ÎÞ *******************************************************************************/ void main() { u8 i; moto=0; //¹Ø±Õµç»ú for(i=0;i<100;i++) //Ñ­»·100´Î£¬Ò²¾ÍÊÇ´óÔ¼5S { moto=1; //¿ªÆôµç»ú delay(5000); //´óÔ¼ÑÓʱ50ms } moto=0; //¹Ø±Õµç»ú while(1) { } } 将程序改成先正转5秒,停10秒,再反转5秒
06-10
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值