Objects that are dynamic and can't be predictably made bindable to
report property change events. It shouldn't be used to wrap typed
objects like instances of B (see later). You can never cast ObjectProxy
to B... the as operator never throws class cast exceptions, it just
returns null if the type isn't correct. If you _did_ happen to end up in
the situation that B was wrapped in an ObjectProxy then you'd have to
unwrap the instance:
var b:B = B(ObjectProxy(o).object_proxy::object);
...but this would be unusual since for serialization purposes in FDS we
do not support typed objects being wrapped in ObjectProxy instances and
sent to the server.
Instead you should add [Bindable] metadta to public class B definition.
If you somehow ended up with an ObjectProxy in the result from an FDS
RPC service (like RemoteObject), then it's likely that the
makeObjectsBindable attribute was true on your service but the type
wasn't registered correctly with a remote class alias. In this case
you'd add [RemoteClass(alias="com.mycompany.B")] to your public class B
definition.
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Vadim Melnik
Sent: Wednesday, April 19, 2006 6:09 PM
To: [email protected]
Subject: [flexcoders] How to override type cast operator @ runtime?
Hi All,
flash.util.Proxy/mx.utils.ObjectProxy classes allow us to override
properties access, methods call etc. Is it possible to override type
cast operations at runtime, like IUnknown:QueryInterface in COM? For
example:
public class B {}
...
var o:* = new ObjectProxy(new B());
var b:B = o as B;
trace(b); // <- writes "null"
// but I am looking for solution to
// hook type cast operation as well
// in other words need in ActionScript 3
// "universal delegate"
--
Thanks,
Vadim Melnik.
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
| Web site design development | Computer software development | Software design and development |
| Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

