Error when using ENTER_TILE
Posted: 22 Feb 2013, 10:38
Hi....
Sorry for bringing each and every problem to here, but I am really struggling to code with openspace
,,,,
I am using AvatarEvent.ENTER_TILE to load diffrent maps. When my avatar enters a particular tile the new map is being loaded, the problem is I am getting the following error trying to do so but irrespective of error the map is loading fine!!!?
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.smartfoxserver.openspace.engine.control::IsoEngineController/http://www.smartfoxserver.com/openspace/osInternal::setGhostPosition()
at com.smartfoxserver.openspace.engine.control.avatar::AvatarAnimator/adjustAvatarRendering()
at com.smartfoxserver.openspace.engine.control.avatar::AvatarAnimator/onAvatarAnimationStep()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at com.greensock::TweenMax/renderTime()
at com.greensock.core::SimpleTimeline/renderTime()
at com.greensock::TweenLite$/updateAll()
My code to load map is,
private function onAvatarTileInteraction(evt:AvatarEvent):void
{
var tile:Tile = evt.params.tile;
var trigger:Trigger = evt.params.trigger;
if (evt.type == AvatarEvent.ENTER_TILE)
{
if (trigger.target == "gotoCoffeeShop")
{
smartFox.send(new LeaveRoomRequest(smartFox.lastJoinedRoom));
openSpace.unloadMap();
openSpace.setSize(765, 478);
mapsLoadManager.loadMap("Temple");
}
}
}
plz help....
Sorry for bringing each and every problem to here, but I am really struggling to code with openspace
I am using AvatarEvent.ENTER_TILE to load diffrent maps. When my avatar enters a particular tile the new map is being loaded, the problem is I am getting the following error trying to do so but irrespective of error the map is loading fine!!!?
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.smartfoxserver.openspace.engine.control::IsoEngineController/http://www.smartfoxserver.com/openspace/osInternal::setGhostPosition()
at com.smartfoxserver.openspace.engine.control.avatar::AvatarAnimator/adjustAvatarRendering()
at com.smartfoxserver.openspace.engine.control.avatar::AvatarAnimator/onAvatarAnimationStep()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at com.greensock::TweenMax/renderTime()
at com.greensock.core::SimpleTimeline/renderTime()
at com.greensock::TweenLite$/updateAll()
My code to load map is,
private function onAvatarTileInteraction(evt:AvatarEvent):void
{
var tile:Tile = evt.params.tile;
var trigger:Trigger = evt.params.trigger;
if (evt.type == AvatarEvent.ENTER_TILE)
{
if (trigger.target == "gotoCoffeeShop")
{
smartFox.send(new LeaveRoomRequest(smartFox.lastJoinedRoom));
openSpace.unloadMap();
openSpace.setSize(765, 478);
mapsLoadManager.loadMap("Temple");
}
}
}
plz help....