Flash8设置及获取Cookies值
点击次数:35 次 发布日期:2008-11-21 23:37:28 作者:源代码网
|
新开发的项目需要到了,正好写下来。 //设置 Cookies 参数
local_data = SharedObject.getLocal("user_data"); local_data.data.user_name = "John Smith"; local_data.data.user_age = 23; local_data.flush() //获取 Cookies 参数 if (local_data.data.user_name != undefined) { this.user = local_data.data.user_age; trace (this.user); } public flush([minDiskSpace:Number]) : Object 将本地永久共享对象立即写入本地文件。如果您不使用此方法,则 Flash 会在共享对象会话结束时(也就是说,在 SWF 文件关闭时、在共享对象由于不再具有引用而被作为垃圾回收时、或者在您调用 SharedObject.clear() 时),将共享对象写入文件。 源代码网供稿. |
