We generally do it in a static in your
class:
Static var doRegister =
Object.registerClass(…, …)
Make sure you have a typed reference to
your class in your Flex app though. The class has to be linked into the SWF
and that means another class must refer to it by its type.
Matt
From:
[email protected] [mailto:[EMAIL PROTECTED] On Behalf Of JesterXL
Sent: Sunday, July 24, 2005 7:12
AM
To: [email protected]
Subject: Re: [flexcoders] Re:
ValueObjects?
Hrm... doing that doesn't work, inside the constructor, or during
initialize
of Application.
Does it matter that this returns false?
trace(remoteObject.method.result instanceof
ContentTemplate);
----- Original Message -----
From: "JesterXL" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Sunday, July 24, 2005 9:43 AM
Subject: Re: [flexcoders] Re: ValueObjects?
OpenAMF you are supposed to configure this in your
openamf config xml file,
and as you said, inside your Flash.
With Flex since I don't have a config file I just
do the ActionScript part
only?
----- Original Message -----
From: "Andrew Spaulding"
<[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Saturday, July 23, 2005 11:32 PM
Subject: [flexcoders] Re: ValueObjects?
Hey Jesse,
I don't think I understand your problem :p
Why can't you just use
Object.registerClass("com.myPackage.myVO",
"com.myPackage.myVO"); in the
constructor of your value object?
This should work fine with openAMF. Can you please
explain your
problem again, I don't understand what is wrong
hehe.
Cheers,
Andrew Spaulding
www.flexdaddy.info
--- In [email protected],
"JesterXL" <[EMAIL PROTECTED]> wrote:
> Currently proving OpenAMF is a piece of $h|t,
hoping you can help.
>
> When hitting Java in Flash, we have to
register our value objects
like so:
>
>
Object.registerClass("com.JavaClass", com.ActionScriptClass);
>
> Then, when we get a response, this'll trace
out true:
>
> function resultHandler(result:ResultEvent):Void
> {
> var item =
result.result;
> trace(item instanceof
ActionScriptClass);
> }
>
> That's because FlashRemoting/OpenAMF will map
the class to the
correct one,
> and the FlashPlayer knows that all instances
of the Java class are
mapped to
> the Flash one.
>
> This works in older projects, with .NET, and
in this current
project, I've
> even got it to work with AMFPHP by merely
changing the gateway...
but not
> OpenAMF.
>
> I've managed to hit the Java via Flex, but am
confused on where to
map my
> value objects. I think I'm actually
using the wrong search words
for the
> FAQ sites and docs... anyone help point me in
the right direction?
Thanks!
>
> --JesterXL
--
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
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
YAHOO! GROUPS LINKS