Page 1 of 1

Loader for Content

Posted: 18 Oct 2012, 02:20
by iiitttaaa
Hey well i dont know if this is the topic, but i would like to know
if you could tell me where to look at to acomplish this:

I have my smartfox and I want to have a Loader, when an action like changeroom is received an extension should be called
The extension should set all new vars and make the laoder load the new swf of the room and grab all users online in the room
with its vars, as clothes, etc.

I havent found a method with the Documentation.
Could you help me?

Re: Loader for Content

Posted: 18 Oct 2012, 19:51
by rjgtav
Hi.
The most practical way of accomplishing that is by storing the relative path to the room's graphic swf inside a RoomVariable.
Then, on the client, when you join a new room, you retrieve that variable's value, and load the swf.
You don't need a server-side extension for that, that's why I'm going to move this topic to the SFS Pro General Discussion forum.

Re: Loader for Content

Posted: 20 Oct 2012, 13:59
by iiitttaaa
Could you write how to retrvie that var because is not working like this:

Code: Select all

smartfox.onRoomListUpdate = function(roomList:Object)
{
	roomList_lb.removeAll()
	for (var i:String in roomList){
   var room:Room = roomList[i]
   var roomVars:Object = room.getVariables();
   trace("roomVars: "+roomVars)
   }
	// Join the default room
	this.autoJoin()
	trace("atuojoin true");
	
}

// Handle roomListUpdate events that occurred before the playhead was moved to this frame
if (evtQueue.length > 0)
{
	smartfox.onRoomListUpdate(evtQueue[0])
	delete evtQueue
}

smartFox.onRoomVariablesUpdate = onRoomVariablesUpdateHandler

function onRoomVariablesUpdateHandler(room:Room, changedVars:Array):Void
{
        // Iterate on the 'changedVars' array to check which variables were updated
        for (var v:String in changedVars)
            trace(v + " room variable was updated; new value is: " + room.getVariable(v))
}
Could you tell me how to look for that var, I have already set the flag to true in RoomListVars in config file, look:

Code: Select all

		<Zone name="simpleChat" customLogin="true" buddyList="20" uCountUpdate="true" maxUsers="10000" roomListVars="true">
       <AutoReloadExtensions>true</AutoReloadExtensions>
			<Rooms>
        
                                <Room name="Room2" maxUsers="12" isPrivate="false" isTemp="false">
	                       <Vars>
		               <Var name="path" type="s" private="true">room/water.swf</Var>
	                        </Vars>
                                 </Room>
                                 
                                <Room name="Room1" maxUsers="12" isPrivate="false" autoJoin="true" isTemp="false">
	                       <Vars>
		               <Var name="path" type="s" private="true">room/lagoon.swf</Var>
	                        </Vars>
                                 </Room>
                               
                               
                               
                                
			</Rooms>
how can i get the var "path" in my flash so i load the room externally?

Re: Loader for Content

Posted: 20 Oct 2012, 19:25
by rjgtav
I've answered to this in your other topic. Please do not mix topics