Packagecom.worlize.api.model
Classpublic class LooseProp
InheritanceLooseProp Inheritance flash.events.EventDispatcher

Product Version : Worlize APIv.2

Represents an instance of a Prop image in the room.

Props can be placed in and moved around the room by anyone as a way temporararily decorate the room or perhaps to virtually give your friend a cup of coffee by placing it next to them in the room.

To add loose props to the room, use the addLooseProp method of the ThisRoom instance.

All loose props will be removed from the room once it becomes empty to prevent abuse.

See also

ThisRoom.addLooseProp()


Public Properties
 PropertyDefined By
  id : uint
[read-only] A unique identifier for this specific LooseProp instance.
LooseProp
  prop : Prop
[read-only] The Prop associated with this LooseProp instance.
LooseProp
  x : int
[read-only] The horizontal position in pixels of the center point of the prop relative to the room's coordinate space.
LooseProp
  y : int
[read-only] The vertical position in pixels of the center point of the prop relative to the room's coordinate space.
LooseProp
Public Methods
 MethodDefined By
  
Constructor.
LooseProp
  
bringForward(layerCount:int):void
Bring the prop forward in the stacking order.
LooseProp
  
Bring the prop all the way forward in the stacking order.
LooseProp
  
moveTo(x:int, y:int):void
Move the prop to a different location in the room
LooseProp
  
remove():void
Remove the loose prop from the room.
LooseProp
  
sendBackward(layerCount:int):void
Send the prop backward in the stacking order.
LooseProp
  
sendToBack():void
Send the prop all the way backward in the stacking order.
LooseProp
Events
 Event Summary Defined By
  Dispatched after the prop has changed position in the stacking order.LooseProp
  Dispatched after the prop has been moved in the room.LooseProp
Property Detail
idproperty
id:uint  [read-only]

Product Version : Worlize APIv.2

A unique identifier for this specific LooseProp instance.


Implementation
    public function get id():uint

See also

com.worlize.model.ThisRoom.getPropById()
propproperty 
prop:Prop  [read-only]

Product Version : Worlize APIv.2

The Prop associated with this LooseProp instance.

The Prop class defines the image that is displayed while the LooseProp identifies a particular instance of that Prop in the room.


Implementation
    public function get prop():Prop

See also

xproperty 
x:int  [read-only]

Product Version : Worlize APIv.2

The horizontal position in pixels of the center point of the prop relative to the room's coordinate space.


Implementation
    public function get x():int
yproperty 
y:int  [read-only]

Product Version : Worlize APIv.2

The vertical position in pixels of the center point of the prop relative to the room's coordinate space.


Implementation
    public function get y():int
Constructor Detail
LooseProp()Constructor
public function LooseProp()

Product Version : Worlize APIv.2

Constructor.

Not meant to be instantiated manually, LooseProp instances are created internally by the Worlize API

Method Detail
bringForward()method
public function bringForward(layerCount:int):void

Product Version : Worlize APIv.2

Bring the prop forward in the stacking order.

This does not immediately affect the stacking order, but rather sends a request to the server to update the stacking order. The actual stacking order will be updated when the confirmation response is received from the server, and a LoosePropEvent.PROP_LAYER_CHANGED event will be dispatched.

bringToFront uses this method internally, passing the largest possible integer 0x7FFFFFFF as the layerCount parameter.

Parameters

layerCount:int — how many layers to bring the prop forward

See also

bringToFront()method 
public function bringToFront():void

Product Version : Worlize APIv.2

Bring the prop all the way forward in the stacking order.

This does not immediately affect the stacking order, but rather sends a request to the server to update the stacking order. The actual stacking order will be updated when the confirmation response is received from the server, and a LoosePropEvent.PROP_LAYER_CHANGED event will be dispatched.

Internally calls sendForward(), passing the largest possible integer 0x7FFFFFFF as the layerCount parameter.

See also

moveTo()method 
public function moveTo(x:int, y:int):void

Product Version : Worlize APIv.2

Move the prop to a different location in the room

Parameters

x:int — the horizontal position for the prop's center
 
y:int — the vertical position for the prop's center

See also

remove()method 
public function remove():void

Product Version : Worlize APIv.2

Remove the loose prop from the room.

This does not immediately remove the prop from the room, but rather sends the request to have the prop removed to the server. Once the server processes the request and broadcasts the update to all the connected clients, then the prop will be removed and a LoosePropEvent.PROP_REMOVED will be dispatched.

See also

sendBackward()method 
public function sendBackward(layerCount:int):void

Product Version : Worlize APIv.2

Send the prop backward in the stacking order.

This does not immediately affect the stacking order, but rather sends a request to the server to update the stacking order. The actual stacking order will be updated when the confirmation response is received from the server, and a LoosePropEvent.PROP_LAYER_CHANGED event will be dispatched.

sendToBack uses this method internally, passing the largest possible integer 0x7FFFFFFF as the layerCount parameter.

Parameters

layerCount:int — how many layers to send the prop backward

See also

sendToBack()method 
public function sendToBack():void

Product Version : Worlize APIv.2

Send the prop all the way backward in the stacking order.

This does not immediately affect the stacking order, but rather sends a request to the server to update the stacking order. The actual stacking order will be updated when the confirmation response is received from the server, and a LoosePropEvent.PROP_LAYER_CHANGED event will be dispatched.

Internally calls sendBackward(), passing the largest possible integer 0x7FFFFFFF as the layerCount parameter.

See also

Event Detail
propLayerChanged Event
Event Object Type: com.worlize.api.event.LoosePropEvent
LoosePropEvent.type property = com.worlize.api.event.LoosePropEvent.PROP_LAYER_CHANGED

Product Version : Worlize API.v2

Dispatched after the prop has changed position in the stacking order.

The LoosePropEvent.PROP_LAYER_CHANGED constant defines the value of the type property of the event object for a propLayerChanged event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelabletrue
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
loosePropA LooseProp instance representing the loose prop that was moved in the stacking order.
oldIndexThe LooseProp's previous position in the stacking order.
newIndexThe LooseProp's new position in the stacking order.
deltaThe change between the LooseProp's old and new position in the stacking order. Will be a positive integer when the prop is brought forward and a negative integer when sent backward.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
propMoved Event  
Event Object Type: com.worlize.api.event.LoosePropEvent
LoosePropEvent.type property = com.worlize.api.event.LoosePropEvent.PROP_MOVED

Product Version : Worlize API.v2

Dispatched after the prop has been moved in the room.

The LoosePropEvent.PROP_MOVED constant defines the value of the type property of the event object for a propMoved event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelabletrue
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
loosePropA LooseProp instance representing the loose prop that was moved.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.