Discussion list for Unity developers.
unity-dev at moock.org
Tue Dec 19 21:16:56 CST 2006
Hi Ryan,
I haven't used unity for a while, but your problem seems very easy to
solve with Unity...
There is something called "room attributes", you can be notified when
a room attribute is changed by handling this event:
function onUpdateRoomAttribute(e:URoomEvent):Void
{
}
and you can change a room attribute with:
setAttribute(roomName, attribute, value);
Hope this helps,
Jose
On 12/20/06, Discussion list for Unity developers. <unity-dev at moock.org> wrote:
> Hello,
>
> I am trying to incorporate Unity into my web app for work. We are a
> non-profit lab and our group is just myself and one other semi-
> developer. Can someone please help me?
>
> Here is the scenario: Each person logged in has a view of a screen
> with 4 buttons on it. When one user selects a button, it becomes
> selected on everyone else's screen. If another user changes the
> selection, everyone's is changed. I was thinking of using a "room
> variable" to do this. But between the listeners and the local
> variables, I am lost.
>
> Here is my code... I need to hook up something like the chat window
> listener so that when I select a button, it sets a room variable
> called "whichButtonIsSelected" and some way of having everyone else's
> screen constantly check to see the state of that variable.
>
> Is this the right way to do it? I am stuck... and the documentation
> and examples works fine for chat, but not for much more.
>
> Thank you so much for your help,
>
> Ryan
> Cambridge, MA
>
>
> import mx.skins.RectBorder;
> import mx.core.ext.UIObjectExtensions;
>
>
>
> // Listen for send Button clicks.
> send.clickHandler = function (e:Object):Void {
> sc.sendMessage();
> }
>
>
> // ////////////////////////////////////////////////////////////////////
>
> // Listen for 4 Button clicks.
> option0.clickHandler = function (e:Object):Void {
> sc.setCurrentButton(this);
> }
> option1.clickHandler = function (e:Object):Void {
> sc.setCurrentButton(this);
> }
> option2.clickHandler = function (e:Object):Void {
> sc.setCurrentButton(this);
> }
> option3.clickHandler = function (e:Object):Void {
> sc.setCurrentButton(this);
> }
>
> // ////////////////////////////////////////////////////////////////////
>
>
>
> // Listen for enter key presses in outgoing.
> var outgoingEnterHandler:Object = new Object();
> outgoingEnterHandler.enter = function (e:Object):Void {
> sc.sendMessage();
> };
> outgoing.addEventListener("enter", outgoingEnterHandler);
>
> // Listen for setName Button clicks.
> setName.clickHandler = function (e:Object):Void {
> sc.setName();
> }
>
> // Listen for enter key presses in nameInput.
> var nameInputEnterHandler:Object = new Object();
> nameInputEnterHandler.enter = function (e:Object):Void {
> sc.setName();
> };
> nameInput.addEventListener("enter", nameInputEnterHandler);
>
>
> //var currentButton:String = "option0";
> //option0.setStyle("themeColor", "haloOrange");
> //option0.setStyle("emphasized", "true");
> //trace("Current selection is on " + currentButton);
>
>
>
> --
> you're a unity-dev subscriber. to unsubscribe, visit www.moock.org/mailman/listinfo/unity-dev/
>
> superb hosting for this list and moock.org is generously provided by Rackspace. See: http://www.rackspace.com/?supbid=moock
>
--
José-Pablo González