HomefieldOfView | SPi-V dev

Navigation

user

logmessage parameter

Hello,

I use something like that to catch the click on the hotspot 1 :

and in director
sendSprite(pSprite, #subscribeMessage, "clickhs1", #spvClicZone, me)

Since I got a lot of hotspot I need to make a function & a subscribeMessage for each zone, clickhs1, clickhs2, clickhs3, clickhs4...

Is there a way to add a parameter after the message to say something like this :

On release, logmessage "clickhs" with parameter "1"

So I can have only one "subscribeMessage" and one function with a parameter to know which hotspot is clicked ??

Thanks
Olivier

Re: logmessage parameter

What if you use something like

message='=getProperty("_this","id")'

in your hotspots behaviors. Wouldn't you get a message that is the name (id) of the hotspot ?

Re: logmessage parameter

That may be a little better since I got a generic call in the XML but I still got the problem to code a "subscribeMessage" for each of my ID in Director...
sendSprite(pSprite, #subscribeMessage, "ID1", #spvClicZone1, me)
sendSprite(pSprite, #subscribeMessage, "ID2", #spvClicZone2, me)
sendSprite(pSprite, #subscribeMessage, "ID3", #spvClicZone3, me)
...
and One function for each of the id too...

on spvClicZone1 me
...
end
on spvClicZone2 me
...
end
...

??????

Thanks
Olivier

Re: logmessage parameter

You might easily customize the SPi-V init behavior in the spvMessage handler, or even write your own behavior attached to Spi-V.dcr with you own spvMessage handler. Then is the message starts with your generic hotspot id first chars, you isolate that part from the actual number of the hotspot and call or sendAllSprites a generic handler with the number as a parameter.

Re: logmessage parameter

I'll create a new version of the SPi-V init behavior that will let you subscribe to messages using a wildcard. Eg:

sendSprite(pSprite, #subscribeMessage, "clickhs*", #spvClicZone, me)

You would then get the entire message as an argument for your callback handler:

on spvClicZone me, aMessage
-- aMessage would be eg "clickhs1"

  case aMessage of
    "clickhs1":
    otherwise:
  end case
end spvClicZone

Re: logmessage parameter

That new version has now been uploaded. Please download the file again and copy over the SPi-V:init behavior (member 7).

http://fieldofview.com/spv/download.php?filelist=integration.lst

Re: logmessage parameter

Works fine !

Thanks Aldo & Emmanuel