#22001/10/29 23:07:41
我写了一下,需要2个xtra,都是free的
1、将行为赋给button
2、按钮cast name为"change"
3、可以不在beginsprite中初始化按钮名称,可以用一个事件 激发,如定时器或者单击按钮什么的,外部文件暂定为buttonname.txt
property pmyFileIO --Obj 创建的FileIO的实例
property pmyFile3 --obj File3Xtra实例
property pMemTxt --str Member的名称
--------------------------------------
on beginSprite me
pmyFileIO=new (Xtra "FileIO")
pmyFile3=xtra("filextra3").new()
pMemTxt="change"
fileAdd=string (the moviePath & "buttonName.txt")
--用FileXtra3判断文件是否存在
if fx_FileExists(pmyFile3,fileAdd)=0 then --文件不存在
alert "没找到按钮命名文件"
return ()
end if
openFile(pMyFileIO,fileAdd,1)
myStr=pMyFileIO.readFile()
member(pMemTxt).text=myStr
pMyFileIO.closeFile() --关闭文件
end
--------------------------------------
编辑历史:[这消息被rainy编辑过(编辑时间2001-10-29 23:10:08)]