Page 1 of 1
tile.addSkin() Help
Posted: 22 Jul 2011, 14:03
by clouting
Hi,
I am trying to use the tile.addSkin() method but am getting the following error when it is called:
1195: Attempted access of inaccessible method addSkin through a reference with static type com.smartfoxserver.openspace.shared.view.items:Tile.
Can I add skins to tiles like this?
thanks
Posted: 22 Jul 2011, 14:55
by Bax
No you can't. In fact that method is not documented in the API.
Skins can be added in the Editor only.
Posted: 25 Jul 2011, 06:50
by clouting
Okay...
Is there anyway I can add a display object tot a tile dynamically? I am trying to add some arrows to show the map exits.
I have tried to use the addChild method but I get the following error when I interact with it (ROLLOVER) etc
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.smartfoxserver.openspace.shared.control.map::MapManager/getTileInstanceData()
Posted: 25 Jul 2011, 12:08
by Bax
You should better explain how this should work.
Posted: 25 Jul 2011, 13:09
by clouting
I have setup a database table to store the location and data of individual exits.
My table contains the coordinate of the exit, the map to load when when the exit is taken and a coordinate for the spawn point when the new map loads.
In the onOpenSpaceMapRendered() method I want to retrieve all the exits for the room I am in and add an arrow to show where the exits are.
Is there a way I can add the arrows to the tile dynamically (through code) rather than having to add them in openspace editor?
When I use tile.addChild(arrow); I get the following error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.smartfoxserver.openspace.shared.control.map::MapManager/getTileInstanceData()
Any ideas??
Thanks
Posted: 25 Jul 2011, 13:21
by Bax
No you can't. You have to use the editor.
Please notice that skins are contained in an sprite called skinsHolder inside the Tile object. Maybe you are able to reach it programmatically and attach that arrow dynamically.