I am trying to do some basic extensions to the examples supplied with the Openspace download.
Heres what I am trying to do. I am extending the Ranch example with a new exit, that takes the player into a quiz (flash based - nothing openspace). The user can cancel the quiz, or complete the quiz to return to the openspace map that they were in.
I have created a new sensor tile on the map
Ive also extended the timeline in the main flash app, and created a simple quiz screen, with a cancel button.
Ive added handlers to the actionscript (in the changeRoom() method) to take the user to the quiz, when they trigger the sensor tile.
Code: Select all
case "ranchQuiz":
trace("User wants to start the quiz");
inGame = true;
currentMap = null;
var gameRoom:Object = new Object()
gameRoom.name = "ranchQuiz"
gameRoom.maxUsers = 1
gameRoom.isGame = true
gameRoom.isTemp = true
smartFox.createRoom(gameRoom)
smartFox.joinRoom(gameRoom.name)
gotoAndPlay("quiz");
break
Code: Select all
inGame = false
nextMap = {}
nextMap.sfsRoomName = "Ranch (inside)"
nextMap.filename = "m1_RanchInside.xml"
nextMap.px = 6
nextMap.py = 10
nextMap.dir = 4
gotoAndStop("openspace")
//smartFox.getRoomList()
smartFox.joinRoom(nextMap.sfsRoomName)
Code: Select all
Avatars' library loaded
Skins' library loaded
Backgrounds' library loaded
Map loaded & parsed: progress status should be displayed
****************************************************************
Internal error:
The room list is empty!
The client API cannot function properly until the room list is populated.
Please consult the documentation for more infos.
****************************************************************
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.smartfoxserver.openspace::OpenSpace/onMapRendered()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.smartfoxserver.openspace.mvc::IsoEngineModel/onMapBuilt()
at com.smartfoxserver.openspace.map::MapManager/onMapGenerationCompleted()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.smartfoxserver.openspace.utils.executor::MultiFrameExecutor/runStep()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()