Pakiet | mx.utils |
Klasa | public dynamic class ObjectProxy |
Dziedziczenie | ObjectProxy Proxy |
Implementuje | IExternalizable, IPropertyChangeNotifier |
Podklasy | DataItem, ManagedObjectProxy |
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
addEventListener()
method.
Właściwość | Zdefiniowane przez | ||
---|---|---|---|
uid : String
The unique identifier for this object. | ObjectProxy |
Właściwość | Zdefiniowane przez | ||
---|---|---|---|
dispatcher : EventDispatcher
A reference to the EventDispatcher for this proxy. | ObjectProxy | ||
notifiers : Object
A hashmap of property change notifiers that this proxy is
listening for changes from; the key of the map is the property name. | ObjectProxy | ||
object : Object [tylko do odczytu]
The object being proxied. | ObjectProxy | ||
propertyList : Array
Contains a list of all of the property names for the proxied object. | ObjectProxy | ||
proxyClass : Class
Indicates what kind of proxy to create
when proxying complex properties. | ObjectProxy | ||
type : QName
The qualified type name associated with this object. | ObjectProxy |
Metoda | Zdefiniowane przez | ||
---|---|---|---|
Initializes this proxy with the specified object, id and proxy depth. | ObjectProxy | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object
so that the listener receives notification of an event. | ObjectProxy | ||
Dispatches an event into the event flow. | ObjectProxy | ||
Checks whether there are any event listeners registered
for a specific type of event. | ObjectProxy | ||
Called when a complex property is updated. | ObjectProxy | ||
Since Flex only uses ObjectProxy to wrap anonymous objects,
the server flex.messaging.io.ObjectProxy instance serializes itself
as a Map that will be returned as a plain ActionScript object. | ObjectProxy | ||
Removes an event listener. | ObjectProxy | ||
Checks whether an event listener is registered with this object
or any of its ancestors for the specified event type. | ObjectProxy | ||
Since Flex only serializes the inner ActionScript object that it wraps,
the server flex.messaging.io.ObjectProxy populates itself
with this anonymous object's contents and appears to the user
as a Map. | ObjectProxy |
Metoda | Zdefiniowane przez | ||
---|---|---|---|
[przesłanianie]
Returns the value of the proxied object's method with the specified name. | ObjectProxy | ||
[przesłanianie]
Deletes the specified property on the proxied object and
sends notification of the delete to the handler. | ObjectProxy | ||
Provides a place for subclasses to override how a complex property that
needs to be either proxied or daisy chained for event bubbling is managed. | ObjectProxy | ||
[przesłanianie]
Returns the specified property value of the proxied object. | ObjectProxy | ||
[przesłanianie]
Updates the specified property on the proxied object
and sends notification of the update to the handler. | ObjectProxy | ||
This method creates an array of all of the property names for the
proxied object. | ObjectProxy |
dispatcher | właściwość |
protected var dispatcher:EventDispatcher
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
A reference to the EventDispatcher for this proxy.
notifiers | właściwość |
protected var notifiers:Object
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
A hashmap of property change notifiers that this proxy is listening for changes from; the key of the map is the property name.
object | właściwość |
object:Object
[tylko do odczytu] Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
The object being proxied.
Implementacja
object_proxy function get object():Object
propertyList | właściwość |
protected var propertyList:Array
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Contains a list of all of the property names for the proxied object.
Descendants need to fill this list by overriding the
setupPropertyList()
method.
proxyClass | właściwość |
protected var proxyClass:Class
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Indicates what kind of proxy to create when proxying complex properties. Subclasses should assign this value appropriately.
type | właściwość |
type:QName
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
The qualified type name associated with this object.
Implementacja
object_proxy function get type():QName
object_proxy function set type(value:QName):void
uid | właściwość |
ObjectProxy | () | Konstruktor |
public function ObjectProxy(item:Object = null, uid:String = null, proxyDepth:int = -1)
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Initializes this proxy with the specified object, id and proxy depth.
Parametryitem:Object (default = null ) — Object to proxy.
If no item is specified, an anonymous object will be constructed
and assigned.
| |
uid:String (default = null ) — String containing the unique id
for this object instance.
Required for IPropertyChangeNotifier compliance as every object must
provide a unique way of identifying it.
If no value is specified, a random id will be assigned.
| |
proxyDepth:int (default = -1 ) — An integer indicating how many levels in a complex
object graph should have a proxy created during property access.
The default is -1, meaning "proxy to infinite depth".
|
Przykład
Sposób korzystania z tego przykładu
import mx.events.PropertyChangeEvent; import mx.utils.ObjectUtil; import mx.utils.ObjectProxy; import mx.utils.StringUtil; var a:Object = { name: "Tyler", age: 5, ssnum: "555-55-5555" }; var p:ObjectProxy = new ObjectProxy(a); p.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, updateHandler); p.name = "Jacey"; p.age = 2; delete p.ssnum; // handler function function updateHandler(event:PropertyChangeEvent):void { trace(StringUtil.substitute("updateHandler('{0}', {1}, {2}, {3}, '{4}')", event.kind, event.property, event.oldValue, event.newValue, event.target.uid)); } // trace output updateHandler('opUpdate', name, Jacey, '698AF8CB-B3D9-21A3-1AFFDGHT89075CD2') updateHandler('opUpdate', age, 2, '698AF8CB-B3D9-21A3-1AFFDGHT89075CD2') updateHandler('opDelete', ssnum, null, '698AF8CB-B3D9-21A3-1AFFDGHT89075CD2')
addEventListener | () | metoda |
public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Registers an event listener object
so that the listener receives notification of an event.
For more information, including descriptions of the parameters see
addEventListener()
in the
flash.events.EventDispatcher class.
Parametry
type:String — The type of event.
| |
listener:Function — The listener function that processes the event. This function must accept
an Event object as its only parameter and must return nothing.
| |
useCapture:Boolean (default = false ) — Determines whether the listener works in the capture phase or the
target and bubbling phases. If useCapture is set to true ,
the listener processes the event only during the capture phase and not in the
target or bubbling phase. If useCapture is false , the
listener processes the event only during the target or bubbling phase. To listen for
the event in all three phases, call addEventListener twice, once with
useCapture set to true , then again with
useCapture set to false .
| |
priority:int (default = 0 ) — The priority level of the event listener.
| |
useWeakReference:Boolean (default = false ) — Determines whether the reference to the listener is strong or
weak. A strong reference (the default) prevents your listener from being garbage-collected.
A weak reference does not.
|
Powiązane elementy interfejsu API
callProperty | () | metoda |
override flash_proxy function callProperty(name:*, ... rest):*
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Returns the value of the proxied object's method with the specified name.
Parametry
name:* — The name of the method being invoked.
| |
... rest — An array specifying the arguments to the
called method.
|
* — The return value of the called method.
|
deleteProperty | () | metoda |
override flash_proxy function deleteProperty(name:*):Boolean
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Deletes the specified property on the proxied object and sends notification of the delete to the handler.
Parametry
name:* — Typically a string containing the name of the property,
or possibly a QName where the property name is found by
inspecting the localName property.
|
Boolean — A Boolean indicating if the property was deleted.
|
dispatchEvent | () | metoda |
public function dispatchEvent(event:Event):Boolean
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Dispatches an event into the event flow. For more information, see the flash.events.EventDispatcher class.
Parametry
event:Event — The Event object that is dispatched into the event flow. If the
event is being redispatched, a clone of the event is created automatically.
After an event is dispatched, its target property cannot be changed, so you
must create a new copy of the event for redispatching to work.
|
Boolean — Returns true if the event was successfully dispatched.
A value
of false indicates failure or that preventDefault()
was called on the event.
|
Powiązane elementy interfejsu API
getComplexProperty | () | metoda |
object_proxy function getComplexProperty(name:*, value:*):*
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Provides a place for subclasses to override how a complex property that needs to be either proxied or daisy chained for event bubbling is managed.
Parametry
name:* — Typically a string containing the name of the property,
or possibly a QName where the property name is found by
inspecting the localName property.
| |
value:* — The property value.
|
* — The property value or an instance of ObjectProxy .
|
getProperty | () | metoda |
override flash_proxy function getProperty(name:*):*
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Returns the specified property value of the proxied object.
Parametry
name:* — Typically a string containing the name of the property,
or possibly a QName where the property name is found by
inspecting the localName property.
|
* — The value of the property.
In some instances this value may be an instance of
ObjectProxy .
|
hasEventListener | () | metoda |
public function hasEventListener(type:String):Boolean
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Checks whether there are any event listeners registered for a specific type of event. This allows you to determine where an object has altered handling of an event type in the event flow hierarchy. For more information, see the flash.events.EventDispatcher class.
Parametry
type:String — The type of event
|
Boolean — Returns true if a listener of the specified type is
registered; false otherwise.
|
Powiązane elementy interfejsu API
propertyChangeHandler | () | metoda |
public function propertyChangeHandler(event:PropertyChangeEvent):void
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Called when a complex property is updated.
Parametry
event:PropertyChangeEvent — An event object that has changed.
|
readExternal | () | metoda |
public function readExternal(input:IDataInput):void
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Since Flex only uses ObjectProxy to wrap anonymous objects, the server flex.messaging.io.ObjectProxy instance serializes itself as a Map that will be returned as a plain ActionScript object. You can then set the object_proxy object property to this value.
Parametry
input:IDataInput — The source object from which the ObjectProxy is
deserialized.
|
removeEventListener | () | metoda |
public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Removes an event listener. If there is no matching listener registered with the EventDispatcher object, a call to this method has no effect. For more information, see the flash.events.EventDispatcher class.
Parametry
type:String — The type of event.
| |
listener:Function — The listener object to remove.
| |
useCapture:Boolean (default = false ) — Specifies whether the listener was registered for the capture
phase or the target and bubbling phases. If the listener was registered for both
the capture phase and the target and bubbling phases, two calls to
removeEventListener() are required to remove both, one call with
useCapture
set to true , and another call with useCapture
set to false .
|
Powiązane elementy interfejsu API
setProperty | () | metoda |
override flash_proxy function setProperty(name:*, value:*):void
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Updates the specified property on the proxied object and sends notification of the update to the handler.
Parametry
name:* — Object containing the name of the property that
should be updated on the proxied object.
| |
value:* — Value that should be set on the proxied object.
|
setupPropertyList | () | metoda |
protected function setupPropertyList():void
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
This method creates an array of all of the property names for the
proxied object.
Descendants must override this method if they wish to add more
properties to this list.
Be sure to call super.setupPropertyList
before making any
changes to the propertyList
property.
willTrigger | () | metoda |
public function willTrigger(type:String):Boolean
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Checks whether an event listener is registered with this object
or any of its ancestors for the specified event type.
This method returns true
if an event listener is triggered
during any phase of the event flow when an event of the specified
type is dispatched to this object or any of its descendants.
For more information, see the flash.events.EventDispatcher class.
Parametry
type:String — The type of event.
|
Boolean — Returns true if a listener of the specified type will
be triggered; false otherwise.
|
Powiązane elementy interfejsu API
writeExternal | () | metoda |
public function writeExternal(output:IDataOutput):void
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Since Flex only serializes the inner ActionScript object that it wraps, the server flex.messaging.io.ObjectProxy populates itself with this anonymous object's contents and appears to the user as a Map.
Parametry
output:IDataOutput — The source object from which the ObjectProxy is
deserialized.
|
Tue Jun 12 2018, 12:06 PM Z