修改TextArea中的文本很简单,不用多说,关键是如何保存并将结果返回到TextArea中。。。
保存按钮:
on(release){
File_name=Text_file_name
trace(File_name)
Content=_parent.contenter.text
trace(Content)
if(Content<>undefined and Text_file_name<>"" and Text_file_name<>undefined){
loadVariables("modify_text.asp","","post")
Modify_confirm._visible=1
Modify_confirm.msg="修改成功,请返回..."
Modify_confirm.Confirm_button.enabled=true
_parent.lyxt.gotoAndStop(1)
}else{
Modify_confirm._visible=1
Modify_confirm.msg="修改失败,请返回..."
}
}
modify_text.asp的内容:
<%
File_name=Request.form("File_name")
CountFile=Server.MapPath(File_name)
SET FileObject=Server.CreateObject("Scripting.FileSystemObject")
Set Out=FileObject.CreateTextFile(CountFile,TRUE,FALSE)
Content=Request.form("Content")
Application.lock
Out.Write(Content)
Application.unlock
out.Close
%>
FLASH中返回文本:
System.useCodepage = true;
contenter.background = true;
contenter.backgroundColor = "0xcccccc";
contenter.fontSize=13
//contenter.textColor = "0x0000000";
contenter.wordWrap = 1;
my_loadvars = new LoadVars();
my_loadvars.load("cgal/sysm.txt");
my_loadvars.onData = function(texter) {
contenter.text =texter
}
保存按钮:
on(release){
File_name=Text_file_name
trace(File_name)
Content=_parent.contenter.text
trace(Content)
if(Content<>undefined and Text_file_name<>"" and Text_file_name<>undefined){
loadVariables("modify_text.asp","","post")
Modify_confirm._visible=1
Modify_confirm.msg="修改成功,请返回..."
Modify_confirm.Confirm_button.enabled=true
_parent.lyxt.gotoAndStop(1)
}else{
Modify_confirm._visible=1
Modify_confirm.msg="修改失败,请返回..."
}
}
modify_text.asp的内容:
<%
File_name=Request.form("File_name")
CountFile=Server.MapPath(File_name)
SET FileObject=Server.CreateObject("Scripting.FileSystemObject")
Set Out=FileObject.CreateTextFile(CountFile,TRUE,FALSE)
Content=Request.form("Content")
Application.lock
Out.Write(Content)
Application.unlock
out.Close
%>
FLASH中返回文本:
System.useCodepage = true;
contenter.background = true;
contenter.backgroundColor = "0xcccccc";
contenter.fontSize=13
//contenter.textColor = "0x0000000";
contenter.wordWrap = 1;
my_loadvars = new LoadVars();
my_loadvars.load("cgal/sysm.txt");
my_loadvars.onData = function(texter) {
contenter.text =texter
}
回复Comments
作者:
{commentrecontent}