Brightscript插件:如何在processEvent中访问用户变量

时间:2014-04-25 08:01:23

标签: brightscript

我跟随"插件和解析器"的例子。 PDF
(见using plugins and parsers technote (PDF)

如何在processEvent函数中访问用户变量(读,写)?

Function pizza_ProcessEvent(event As Object)
  if type(event) = "roAssociativeArray" then
    if type(event["EventType"]) = "roString" then
      if event["EventType"] = "SEND_PLUGIN_MESSAGE" then
        if event["PluginName"] = "Pizza" then
          pluginMessage$ = event["PluginMessage"]
          print "received pluginMessage ";pluginMessage$
          return true
        endif
      endif
    endif 
  endif
  return false
End Function

1 个答案:

答案 0 :(得分:1)

它们应该在m中,这是与self / this相当的BrS。

即。什么时候对于PizzaBuilder的实例pb方法(或事件;“成员函数”真的) 调用pb.processEvent(),其中包含一个魔术变量m指向pb。所以你要求的 - 基于PDF样本 - 可能是m.userVariables

免责声明:我知道Roku的B / S,而不是BrightSign;他们密切相关。