作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
寻找有关如何实现返回 AsyncToken 的方法的示例或文档链接。
请注意,这与使用/使用返回 AsyncToken 的方法无关!我希望自己编写这样的方法。
最佳答案
实现一个返回 AsyncToken 的方法很简单:
function doStuffLater():AsyncToken {
var token:AsyncToken = new AsyncToken(null);
// This method will randomly call the responder's 'result' or 'fault'
// handler.
function doStuff() {
var response:String = (Math.random() > 0.5)? "result" : "fault";
for each (responder:IResponder in (token.responders || [])) {
// rememeber: this is equivilent to
// responder.result(...) or responder.fault(...)
responder[response]("Got a result!");
}
}
setTimeout(doStuff, 1000);
return token;
}
applyResult
和
applyFault
方法,因为它们向响应者传递了
Event
,当响应者除了结果或故障对象。
关于actionscript-3 - ActionScript 3 AsyncToken 实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1052858/
我是 Flex 新手,我似乎无法让它工作。本质上,我有一个选择框,它的可用数据依赖于另一个组合框。 每个CategoryType中有多个TreatmentType。 这是我的代码: 组合框更改;更新选
寻找有关如何实现返回 AsyncToken 的方法的示例或文档链接。 请注意,这与使用/使用返回 AsyncToken 的方法无关!我希望自己编写这样的方法。 最佳答案 实现一个返回 AsyncTok
我试图了解 AsyncToken 在 actionscript 中的工作方式。如何调用远程服务并确保特定参数在结果或故障事件函数中可用?我认为这是我想要使用的异步功能。 下面的代码有望解释我正在尝试做
使用欧芹,我有一项服务,我通过[命令(选择器='列表')]公共(public)函数 getRssFeed(msg:RssEvent):AsyncToken{返回 service.list() 作为 A
我正在使用 RobotLegs、LiveCycle DS 和 Java 开发 Flex 应用程序。我正在尝试使用 LCDS 实现更新功能,但遇到了一些奇怪的行为: 这是 RobotLegs 的 exe
我是一名优秀的程序员,十分优秀!