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....
Error when using ENTER_TILE
Re: Error when using ENTER_TILE
Hi
I've never actually worked with OpenSpace, but if I'm not mistaken in order to load a new map you simply need to join the new room and the engine will automatically load the new map. When you send a JoinRoomRequest the server automatically removes the user from the previous room.
Can you try sending a JoinRoomRequest instead of leaving the current room?
Thanks
I've never actually worked with OpenSpace, but if I'm not mistaken in order to load a new map you simply need to join the new room and the engine will automatically load the new map. When you send a JoinRoomRequest the server automatically removes the user from the previous room.
Can you try sending a JoinRoomRequest instead of leaving the current room?
Thanks
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Re: Error when using ENTER_TILE
Hi rjgtav,
As you said loading a new map automatically makes the avatar leave the old room, loadMap property does this for us. So my code to leave old room was of no need.
But the error was in " openSpace.unloadMap(); "!!! So when I removed this line and the one which I wrote to leave the room, everything worked fine....
Thanks a lot for your help...
As you said loading a new map automatically makes the avatar leave the old room, loadMap property does this for us. So my code to leave old room was of no need.
But the error was in " openSpace.unloadMap(); "!!! So when I removed this line and the one which I wrote to leave the room, everything worked fine....
Thanks a lot for your help...
Re: Error when using ENTER_TILE
Oh, glad you managed to fix it
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Return to “OpenSpace v2 discussions and help”
Who is online
Users browsing this forum: No registered users and 16 guests