1

问题

使用 Director 11.5 和 Windows 7 以及MouseWheel Xtra (wheelmouse.zip),当我在调试器停止时滚动鼠标时,我会在消息窗口中看到以下消息:

lcr_stk_PopFrame: unbalanced stk lcr_stk_PopFrame: unbalanced stk prev=1560 top=1568

然后,通常不再可能继续单步执行代码或检查变量、打开列表等。有时 Director 会崩溃。

如果在调试器中停止时我不滚动,则没有问题。但是调试的时候真的很难不滚动...

如何重现

  • 创建一部新的导演电影
  • 把东西放在舞台上
  • 将以下代码粘贴到电影脚本中
  • 在 on mouseDown 处理程序中放置一个断点
  • 点击舞台
  • 滚动鼠标滚轮
  • 尝试在处理程序中逐步并在变量检查器中打开列表

行话代码:

on startmovie
  put "sartWheelMouse"
  startWheelMouse()
end

on stopMovie
  put "closeWheelMouse"
  closeWheelMouse()
end 


on WheelMouseEvent (nVal)
  -- This is a workaround. Putting the param or an integer allows further operation.
  -- Without it, putting a string or even assigning a string to a var will 
  -- produce problem if user scrolls while stopped in debugger
  --put nVal

  -- this one doesn't harm
  aa = 45

  -- problem if the workaround is not present
  aa = "SAGFD"

  -- problem if the workaround is not present
  aa = string(34)

  -- problem if the workaround is not present
  put "wheelMouseEvnt enter"

end


on mouseDown me
  put "mousedown"

  -- Put a breakpoint here. THen step by step and open the list in the variable inspector
  -- Without the workaround in WheelMouseEvent, if you scroll while the debugger is stopped, 
  -- the debugger doesent work anymore, the list cannot be inspected and sometimes, Director crashes.
  a = 32
  b = "a234"

  lst = ["asdfk asldjasdflkj", "asdfk asldjasdflkj", "asdfk asldjasdflkj"]

  a = 32
  b = "a234"

end
4

1 回答 1

1

我没有真正的解决方案,而是一种解决方法。

正如评论中所解释的,只需在 WheelMouseEvent 处理程序中添加一个带有整数的 put,问题就消失了。

put nVal 

如果有人找到另一种解决方案,比填充消息窗口更离散,我很感兴趣。

于 2012-06-15T01:56:14.677 回答