Page 1 of 1

MapInteractionEvent.SKIN_CLICK returned skin issue

Posted: 23 Sep 2010, 23:02
by svizzari
Hi guys -- having an issue with skin instance returned in MapInteractionEvent.SKIN_CLICK event. I would expect that if the tile containing that skin had a custom name I would be able to access it using

Code: Select all

skin.parent.parent.name
.

Sometimes this seems to work, other times the tile instance at parent.parent has no name (empty string) or a name created by Flash at runtime, i.e. instance1234.

Posted: 24 Sep 2010, 11:43
by Bax
OpenSpace assigns an instance name to the tile only if you set it in the Map Editor.

Posted: 24 Sep 2010, 20:58
by svizzari
Or if you assign one during a drag-n-drop operation? The fact that tiles can be assigned a dynamic name during drag-n-drop is the basis for my assumptions about tile instance names.

In my scenario I am actually modifying JSON on the server to insert some 'system-generated' inventory items (not available to users).

Perhaps my methodology is incorrect but I am simply adding ii, n and trig JSON structure then saving the map again from the server side.

Posted: 27 Sep 2010, 07:32
by Bax
I guess the problem is that you are not assigning a name to the tile instance.
Add a name to an instance on a test map using the Editor, then open the map JSOn and check which parameter you have to add in your custom system.
During drag & drop you can set the instance name, check the IOpenSpace.dragInventoryItem method signature.

Posted: 27 Sep 2010, 08:45
by svizzari
hey bax -- yep, that was my original process in determining how to modify the JSON map structure. I'll re-check to be sure that instance names have been assigned to the relevant tiles however I'm 99% sure they have ;)