作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这就是我所做的:在“本地存储”对话框中,我将指针设置为“无”以允许 0 kB。然后我运行我的代码。我收到带有 [允许] 和 [拒绝] 按钮的“本地存储”对话框。我点击[拒绝]
我得到的输出是
2. we are here now
3. adding a handler to the SharedObject
2. we are here now
3. adding a handler to the SharedObject
var so: SharedObject = null;
var flushStatus: String = null;
so = SharedObject.getLocal('mySpace');
try {
flushStatus = so.flush();
} catch (error: Error) {
trace('1. could not write SharedObject to disk');
}
trace('2. we are here now');
if (flushStatus == flash.net.SharedObjectFlushStatus.PENDING) {
trace('3. adding a handler to the SharedObject');
so.addEventListener(NetStatusEvent.NET_STATUS, onFlushStatus);
}
public function onFlushStatus(event: NetStatusEvent): void
{
trace('4. in event handler');
}
var so: SharedObject = null;
var flushStatus: String = null;
so = SharedObject.getLocal('mySpace');
trace('0. adding a handler to the SharedObject');
so.addEventListener(NetStatusEvent.NET_STATUS, onFlushStatus);
flushStatus = so.flush();
trace('2. we are here now');
public function onFlushStatus(event: NetStatusEvent): void
{
trace('4. in event handler');
}
0. adding a handler to the SharedObject
2. we are here now
0. adding a handler to the SharedObject
2. we are here now
最佳答案
来自 this链接似乎是 so.flush
正在返回 String
与 flush()
的结果命令。与其寻找要触发的事件,不如查看返回值。如果是 pending
然后添加您的事件监听器并检查成功/失败。
一个很好的例子:here
关于actionscript-3 - 弹性 : NetStatusEvent not fired by Local Shared Object. 为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15498512/
这就是我所做的:在“本地存储”对话框中,我将指针设置为“无”以允许 0 kB。然后我运行我的代码。我收到带有 [允许] 和 [拒绝] 按钮的“本地存储”对话框。我点击[拒绝] 我得到的输出是 2. w
我是一名优秀的程序员,十分优秀!