as2.0与asp

发布时间:2010-03-07 19:18:40 阅读:1330次

1、flash按钮链接

on(click){
 getURL("http://baidu.com","_blank");
}

2、msgvar动态文本框变量名称

on(release){
 msgvar="hello,您好"
}

3、组件按钮,_root

on(click){
 _root.msgvar="您好啊"
}

4、加载文本文件带滚动条

on(release){
tt = new LoadVars();//创建一个 LoadVars 对象的实例,这里的实例名字叫tt
tt.load("test.txt");//创建的tt实例需要载入的对象是test.txt文本文件。
tt.onLoad = function(s) { //开始载入外部文件,具体格式请按照此例格式。参数s是指示 load 操作是否成功完成。如果完成,那么S的值就为true( 真),反之为false(假)
if (s) {
msg.text = tt.msgvar;
}//如果载入成功,则msg文本框中的内容就等于tt.实例中的msgvar的内容!(msgvar是我们外部文本文件中的变量。)
}
}
5、读文本文件数据

on(release){
 loadVariablesNum("test.txt",0)
}

test.txt

msgvar=哈哈哈,这样就行了,hello the world!哈哈哈,这样就行了,hello the world!哈哈哈,这样就行了,hello the world!哈哈哈,这样就行了,hello the world!哈哈哈,这样就行了,hello the world!哈哈哈,这样就行了,hello the world!哈哈哈,这样就行了,hello the world!哈哈哈,这样就行了,hello the world!哈哈哈,这样就行了,hello the world!哈哈哈,这样就行了,hello the world!哈哈哈,这样就行了,hello the world!哈哈哈,这样就行了,hello the world!哈哈哈,这样就行了,hello the world!哈哈哈,这样就行了,hello the world!

6、读asp数据

动态文本框usernm,dtxt

System.useCodepage=true
var lv=new LoadVars()
lv.load("mytxt.asp?bina="+random(9999))
lv.onLoad=function(success){
 if(success){
  var username=lv.username
  var time=lv.dsecond
  //trace("加载成功")
  //trace(username+"/"+time)
  dtxt.text=time;
  usernm.text=username;
 }
 else{
  //trace("加载失败")  
 }
}

mytxt.asp

<!--#include file="conn.asp"-->
<%
dim rs
set rs=server.createobject("adodb.recordset")
rs.open "Select username from userinfo",conn,1,2
%>
&username=<%=rs("username")%>&dsecond=<%=second(now())%>

7、向asp发送数据

三个输入文本框,username,sex,age,一个动态文本框msg

System.useCodepage=true;
username.border=true;
sex.border=true;
age.border=true;
mybtn.onRelease = function() {
 if(username.text==""||sex.text==""||age.text==""){
  msg.text="信息不完整啊"
 }
 else{
var my_send = new LoadVars();
my_send.username = username.text;
my_send.sex = sex.text;
my_send.age = age.text;
//上面3行是要发送的数据
my_send.send("send.asp", "_self","post");
}
}

如有问题,可以QQ搜索群1028468525加入群聊,欢迎一起研究技术

支付宝 微信

有疑问联系站长,请联系QQ:QQ咨询
上一篇:flash文字按钮
下一篇:actionscript

转载请注明:as2.0与asp 出自老鄢博客 | 欢迎分享