Packagewidgetfactory.communication
Classpublic class BaseRoomProxy
InheritanceBaseRoomProxy Inheritance Object
Implements IRoom
Subclasses BaseSlideRoomProxy

Creates an object that acts as a proxy between the room object and the widget. Captivate imports widgets into their own Application Domain, this means that custom classes (which is any class not created by Adobe) cannot be shared across widget instances. This means that you can't assign a Widget Room object to a variable typed to the same class as the room.

Like this, you can't do this:

     
         var room:BaseRoom = WidgetRooms.joinRoom("nameOfRoom", widgetSlide, memberObject, "Steve", BaseRoom);
     
     

If there is only one instance of the widget on stage then this code won't cause an error, because that one widget isn't sharing classes with anyone. However, when another widget tries to joining the room and assign the room object to the BaseRoom class, then Captivate will view that as an error. It would be like trying to assign a Sprite object to a Number variable.

The easiest way to get around this is to not give the 'room' variable any type. However this will break the strong typing of the application and is not best practise.

By using a proxy object, you can keep the strong typing between widgets and room objects. Both BaseRoom and BaseRoomProxy implement the IRoom interface, this ensures that they have the same methods and properties. Here's how you can set up a BaseRoomProxy

     
         var unTypedRoom = WidgetRooms.joinRoom("nameOfRoom", widgetSlide, memberObject, "Steve", BaseRoom);
         var room:BaseRoomProxy = new BaseRoomProxy(unTypedRoom);
     
     

For the rest of the program, use the BaseRoomProxy object held in the 'room' variable to interact with the room.

There is also a BaseSlideRoomProxy class to use with BaseSlideRoom objects.

If you have created your own custom room by extending either of the base room classes, then you can also extend the appropriate proxy class to create your own strongly typed proxy for your custom room.



Public Properties
 PropertyDefined By
  isRoom : Boolean
[read-only] A property that WidgetRooms looks for when it is trying to locate a room object.
BaseRoomProxy
  location : MovieClip
[read-only] The location where the room has been created.
BaseRoomProxy
  name : String
[read-only] The name given to the room when it was created.
BaseRoomProxy
  numMembers : int
[read-only] The number of members that are registered with the room.
BaseRoomProxy
  room : Object
The loosely typed room object.
BaseRoomProxy
Public Methods
 MethodDefined By
  
BaseRoomProxy(room:Object)
Creates a new instance of the BaseRoomProxy class.
BaseRoomProxy
  
deregister(member:Object):void
Removes a member from the member list so that it can no longer be found with getMemberByName or getMembersByRole.
BaseRoomProxy
  
getMemberByName(memberName:String, role:String):Object
Returns the member object that matches the name and role that are passed in.
BaseRoomProxy
  
getMemberRole(member:Object):String
Takes the member object and finds what role it belongs it.
BaseRoomProxy
  
getMembersByRole(role:String):Array
Returns a list of all members that belong to a particular role.
BaseRoomProxy
  
register(member:Object, memberName:String, role:String):void
Registers a member with the room's member list.
BaseRoomProxy
Property Detail
isRoomproperty
isRoom:Boolean  [read-only]

A property that WidgetRooms looks for when it is trying to locate a room object.


Implementation
    public function get isRoom():Boolean
locationproperty 
location:MovieClip  [read-only]

The location where the room has been created. Normally this would be the Captivate Main Timeline (cpVariables). However, for Slide Rooms this should be the slide the room is attached to.


Implementation
    public function get location():MovieClip
nameproperty 
name:String  [read-only]

The name given to the room when it was created.


Implementation
    public function get name():String
numMembersproperty 
numMembers:int  [read-only]

The number of members that are registered with the room.


Implementation
    public function get numMembers():int
roomproperty 
room:Object

The loosely typed room object.


Implementation
    public function get room():Object
    public function set room(value:Object):void
Constructor Detail
BaseRoomProxy()Constructor
public function BaseRoomProxy(room:Object)

Creates a new instance of the BaseRoomProxy class.

Parameters
room:Object — The loosely typed room object that we are creating a proxy for.
Method Detail
deregister()method
public function deregister(member:Object):void

Removes a member from the member list so that it can no longer be found with getMemberByName or getMembersByRole.

This does not guarantee that the member will lose all references to the room, or that it will no longer be able to make changes.

Parameters

member:Object — The member object that you wish to remove from the member list.

getMemberByName()method 
public function getMemberByName(memberName:String, role:String):Object

Returns the member object that matches the name and role that are passed in.

Parameters

memberName:String — The name of the member
 
role:String — The role that the member has (Will default to the common role)

Returns
Object — The member object
getMemberRole()method 
public function getMemberRole(member:Object):String

Takes the member object and finds what role it belongs it.

Parameters

member:Object — The member object.

Returns
String — The role the member belongs to.
getMembersByRole()method 
public function getMembersByRole(role:String):Array

Returns a list of all members that belong to a particular role. By default, it will return a list of all members under the Common Role.

Parameters

role:String — The role that you wish to create the list from.

Returns
Array — An array of all members that belong to that role.
register()method 
public function register(member:Object, memberName:String, role:String):void

Registers a member with the room's member list. The member is categorized by its name and role. If no role is provided, it is categorized under the default common role.

Parameters

member:Object — The literal member object
 
memberName:String — The name that identifies the member object
 
role:String — The role that the member object will be categorized under