MapInteractionEvent.SKIN_CLICK returned skin issue

Post here your questions about the OpenSpace 2.x or notify bugs and suggestions.

Moderators: Lapo, Bax

User avatar
svizzari
Posts: 64
Joined: 18 Jun 2010, 11:55

MapInteractionEvent.SKIN_CLICK returned skin issue

Postby svizzari » 23 Sep 2010, 23:02

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.
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 24 Sep 2010, 11:43

OpenSpace assigns an instance name to the tile only if you set it in the Map Editor.
Paolo Bax
The SmartFoxServer Team
User avatar
svizzari
Posts: 64
Joined: 18 Jun 2010, 11:55

Postby svizzari » 24 Sep 2010, 20:58

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.
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 27 Sep 2010, 07:32

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.
Paolo Bax
The SmartFoxServer Team
User avatar
svizzari
Posts: 64
Joined: 18 Jun 2010, 11:55

Postby svizzari » 27 Sep 2010, 08:45

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 ;)

Return to “OpenSpace v2 discussions and help”

Who is online

Users browsing this forum: No registered users and 57 guests