组件 PHP MYSQL的新闻发布系统

2008-04-02 10:31:03来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折


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

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇: 鼠标拖曳的时钟

下一篇: 韩国导航条解析