如何在 IDE 中测试 AIR NativeWindow.invoke?
我正在尝试调试调用处理程序。当我第二次启动 AIR 应用程序时,Flash Builder IDE 似乎停止了正在运行的 AIR 应用程序,因此我永远无法调试第二次调用(即当应用程序已经运行时)。
有什么想法吗?
(PS 除了全局计数器之外,还有什么巧妙的方法可以区分第一个和后续调用事件之间的区别?)
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx"
invoke="onInvoke(event)">
<fx:Script>
<![CDATA[
private function onInvoke(event : InvokeEvent) : void
{
logText.text +=
"invoke: event.arguments = " + event.arguments.toString() +
"; event.currentDirectory = " + ((event.currentDirectory != null) ? event.currentDirectory.nativePath : "null") +
"; event.reason = " + ((event.reason != null) ? event.reason : "null") + "\n";
}
]]>
</fx:Script>
<s:TextArea id="logText" left="10" right="10" top="105" bottom="10"/>
</s:WindowedApplication>
I am trying to debug an invoke handler. The Flash Builder IDE seems to stop the running AIR application when I start it the second time, so I never get to debug the second invoke (i.e. while the application is already running).
Any ideas?
(P.S. any clever way to tell the difference between the first and subsequent invoke events other than a global counter?)
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx"
invoke="onInvoke(event)">
<fx:Script>
<![CDATA[
private function onInvoke(event : InvokeEvent) : void
{
logText.text +=
"invoke: event.arguments = " + event.arguments.toString() +
"; event.currentDirectory = " + ((event.currentDirectory != null) ? event.currentDirectory.nativePath : "null") +
"; event.reason = " + ((event.reason != null) ? event.reason : "null") + "\n";
}
]]>
</fx:Script>
<s:TextArea id="logText" left="10" right="10" top="105" bottom="10"/>
</s:WindowedApplication>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案似乎是无法在 IDE 内测试后续调用。
没关系:您可以放置一个大而难看的测试按钮,该按钮在检测到这不是第一次出现时调用 invokeHandler() 会调用的任何内容。
The answer seems to be that one cannot test subsequent invocations inside the IDE.
That's okay: you can put a big, ugly testing button that calls whatever the invokeHandler() would have called when it detected that it was not the first occurrence.