|
Home > Archive > Macromedia Flash Server > July 2006 > Server-side ActionScript server call client problem
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Server-side ActionScript server call client problem
|
|
| JesterXL 2006-07-06, 1:11 pm |
| I'm having problems using client.call for server-side ActionScript. It
works ok in Flash Player 8, but not in Flash Player 9. The cause is the way
callPrefix works in server-side ActionScript. So, if I have a Lobby
component called "_DEFAULT_" with a method of "setUsername", I'd go:
client.call ( this.callPrefix + "setUsername", null, "someName");
My client-side component would have it's method called IF the same namespace
is setup on the NetConnection object, like so:
nc["Lobby"] = {};
nc["Lobby"]["_DEFAULT_"] = this;
function setUsername ( str )
{
}
....however, this dynamic stuff doesn't work in Flash Player 9. You CAN call
methods; however, they have to be in the public namespace (not protected or
private), and you can't use callPrefix on the server-side. I've tried a ton
of things:
- used an anonymous object to forward the method
- extended NetConnection to be dynamic
- strongly typed the namespaces
- used a custom class instead of namespaces
- combination of the above techniques
Nothing works. I'm thinking a quick fix will be to remove callPrefix from
the server-side ActionScript and instead make it a parameter, and handle the
namespace routing via the extended client side NetConnection class.
Thoughts? Ideas? Solutions?
--JesterXL
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
| |
| David Simmons 2006-07-06, 1:11 pm |
| Hey Jester -
I can't tell exactly if you're using AS3, but if so, check out
http://livedocs.macromedia.com/labs...net/NetConnecti
on.html
There is a read/write "client" property on NetConnections (and NetStream
and SharedObjects) and this is where you can attach remote functions or
your own data. Otherwise the class is closed and you can't just assign
new properties like in AS2.
If you're using AS2, then this is a compatibility problem we need to
sort out.
Hope this helps,
- Dave Simmons
Adobe Engineering
-----Original Message-----
From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
[mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of JesterXL
Sent: Thursday, July 06, 2006 10:04 AM
To: flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
Subject: [FlashComm] Server-side ActionScript server call client problem
I'm having problems using client.call for server-side ActionScript. It=20
works ok in Flash Player 8, but not in Flash Player 9. The cause is the
way=20
callPrefix works in server-side ActionScript. So, if I have a Lobby=20
component called "_DEFAULT_" with a method of "setUsername", I'd go:
client.call ( this.callPrefix + "setUsername", null, "someName");
My client-side component would have it's method called IF the same
namespace=20
is setup on the NetConnection object, like so:
nc["Lobby"] =3D {};
nc["Lobby"]["_DEFAULT_"] =3D this;
function setUsername ( str )
{
}
....however, this dynamic stuff doesn't work in Flash Player 9. You CAN
call=20
methods; however, they have to be in the public namespace (not protected
or=20
private), and you can't use callPrefix on the server-side. I've tried a
ton=20
of things:
- used an anonymous object to forward the method
- extended NetConnection to be dynamic
- strongly typed the namespaces
- used a custom class instead of namespaces
- combination of the above techniques
Nothing works. I'm thinking a quick fix will be to remove callPrefix
from=20
the server-side ActionScript and instead make it a parameter, and handle
the=20
namespace routing via the extended client side NetConnection class.
Thoughts? Ideas? Solutions?
--JesterXL=20
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
| |
| JesterXL 2006-07-06, 1:11 pm |
| I found that yesterday for SharedObject, and 2 seconds after I sent the
email, I went to see if NetConnection had it, and lo and behold, he has it
too!
I'll try that. It already worked for my SharedObject's so I'm sure it'll
work for NetConnection too.
:: goes to try ::
----- Original Message -----
From: "David Simmons" <dsimmons-dv/VyGpifdQAvxtiuMwx3w@public.gmane.org>
To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
Sent: Thursday, July 06, 2006 1:14 PM
Subject: RE: [FlashComm] Server-side ActionScript server call client problem
Hey Jester -
I can't tell exactly if you're using AS3, but if so, check out
http://livedocs.macromedia.com/labs...net/NetConnecti
on.html
There is a read/write "client" property on NetConnections (and NetStream
and SharedObjects) and this is where you can attach remote functions or
your own data. Otherwise the class is closed and you can't just assign
new properties like in AS2.
If you're using AS2, then this is a compatibility problem we need to
sort out.
Hope this helps,
- Dave Simmons
Adobe Engineering
-----Original Message-----
From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
[mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of JesterXL
Sent: Thursday, July 06, 2006 10:04 AM
To: flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
Subject: [FlashComm] Server-side ActionScript server call client problem
I'm having problems using client.call for server-side ActionScript. It
works ok in Flash Player 8, but not in Flash Player 9. The cause is the
way
callPrefix works in server-side ActionScript. So, if I have a Lobby
component called "_DEFAULT_" with a method of "setUsername", I'd go:
client.call ( this.callPrefix + "setUsername", null, "someName");
My client-side component would have it's method called IF the same
namespace
is setup on the NetConnection object, like so:
nc["Lobby"] = {};
nc["Lobby"]["_DEFAULT_"] = this;
function setUsername ( str )
{
}
....however, this dynamic stuff doesn't work in Flash Player 9. You CAN
call
methods; however, they have to be in the public namespace (not protected
or
private), and you can't use callPrefix on the server-side. I've tried a
ton
of things:
- used an anonymous object to forward the method
- extended NetConnection to be dynamic
- strongly typed the namespaces
- used a custom class instead of namespaces
- combination of the above techniques
Nothing works. I'm thinking a quick fix will be to remove callPrefix
from
the server-side ActionScript and instead make it a parameter, and handle
the
namespace routing via the extended client side NetConnection class.
Thoughts? Ideas? Solutions?
--JesterXL
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
| |
| JesterXL 2006-07-06, 1:11 pm |
| ....ok, the NetConnection.client works just like the NetConnection does. As
long as you don't use the callPrefix, you can call methods on either the
NetConnection, or the NetConnection.client object.
What doesn't work is any type of namespacing. How the heck does client.call
convert the slashes to dot's anyway?
Like, my callPrefix is "Lobby/_DEFAULT_" when I trace it out server-side.
Hrm........
----- Original Message -----
From: "JesterXL" <jesterxl-RyEax5csP4NCVeB36W80OQ@public.gmane.org>
To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
Sent: Thursday, July 06, 2006 1:18 PM
Subject: Re: [FlashComm] Server-side ActionScript server call client problem
I found that yesterday for SharedObject, and 2 seconds after I sent the
email, I went to see if NetConnection had it, and lo and behold, he has it
too!
I'll try that. It already worked for my SharedObject's so I'm sure it'll
work for NetConnection too.
:: goes to try ::
----- Original Message -----
From: "David Simmons" <dsimmons-dv/VyGpifdQAvxtiuMwx3w@public.gmane.org>
To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
Sent: Thursday, July 06, 2006 1:14 PM
Subject: RE: [FlashComm] Server-side ActionScript server call client problem
Hey Jester -
I can't tell exactly if you're using AS3, but if so, check out
http://livedocs.macromedia.com/labs...net/NetConnecti
on.html
There is a read/write "client" property on NetConnections (and NetStream
and SharedObjects) and this is where you can attach remote functions or
your own data. Otherwise the class is closed and you can't just assign
new properties like in AS2.
If you're using AS2, then this is a compatibility problem we need to
sort out.
Hope this helps,
- Dave Simmons
Adobe Engineering
-----Original Message-----
From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
[mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of JesterXL
Sent: Thursday, July 06, 2006 10:04 AM
To: flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
Subject: [FlashComm] Server-side ActionScript server call client problem
I'm having problems using client.call for server-side ActionScript. It
works ok in Flash Player 8, but not in Flash Player 9. The cause is the
way
callPrefix works in server-side ActionScript. So, if I have a Lobby
component called "_DEFAULT_" with a method of "setUsername", I'd go:
client.call ( this.callPrefix + "setUsername", null, "someName");
My client-side component would have it's method called IF the same
namespace
is setup on the NetConnection object, like so:
nc["Lobby"] = {};
nc["Lobby"]["_DEFAULT_"] = this;
function setUsername ( str )
{
}
....however, this dynamic stuff doesn't work in Flash Player 9. You CAN
call
methods; however, they have to be in the public namespace (not protected
or
private), and you can't use callPrefix on the server-side. I've tried a
ton
of things:
- used an anonymous object to forward the method
- extended NetConnection to be dynamic
- strongly typed the namespaces
- used a custom class instead of namespaces
- combination of the above techniques
Nothing works. I'm thinking a quick fix will be to remove callPrefix
from
the server-side ActionScript and instead make it a parameter, and handle
the
namespace routing via the extended client side NetConnection class.
Thoughts? Ideas? Solutions?
--JesterXL
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
| |
| David Simmons 2006-07-06, 1:11 pm |
| I'm taking a guess here, but I think the code must not like the slash as
an invalid character in a property name.
Under the hood, a NetConnection call gets sent from the server to client
with information on what function to call, the parameters and a return
object. The player matches the call() function name to a property with
the same name attached to NetConnection.client. If it finds a match,
and that property is a function pointer, it will call the function.
I'm pretty sure you can't use a property name with the slash in it, and
it's getting stripped out or converted at some stage.
- Dave Simmons
Adobe Engineering
-----Original Message-----
From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
[mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of JesterXL
Sent: Thursday, July 06, 2006 10:51 AM
To: FlashComm Mailing List
Subject: Re: [FlashComm] Server-side ActionScript server call client
problem
....ok, the NetConnection.client works just like the NetConnection does.
As=20
long as you don't use the callPrefix, you can call methods on either the
NetConnection, or the NetConnection.client object.
What doesn't work is any type of namespacing. How the heck does
client.call=20
convert the slashes to dot's anyway?
Like, my callPrefix is "Lobby/_DEFAULT_" when I trace it out
server-side.
Hrm........
----- Original Message -----=20
From: "JesterXL" <jesterxl-RyEax5csP4NCVeB36W80OQ@public.gmane.org>
To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
Sent: Thursday, July 06, 2006 1:18 PM
Subject: Re: [FlashComm] Server-side ActionScript server call client
problem
I found that yesterday for SharedObject, and 2 seconds after I sent the
email, I went to see if NetConnection had it, and lo and behold, he has
it
too!
I'll try that. It already worked for my SharedObject's so I'm sure
it'll
work for NetConnection too.
:: goes to try ::
----- Original Message -----=20
From: "David Simmons" <dsimmons-dv/VyGpifdQAvxtiuMwx3w@public.gmane.org>
To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
Sent: Thursday, July 06, 2006 1:14 PM
Subject: RE: [FlashComm] Server-side ActionScript server call client
problem
Hey Jester -
I can't tell exactly if you're using AS3, but if so, check out
http://livedocs.macromedia.com/labs...net/NetConnecti
on.html
There is a read/write "client" property on NetConnections (and NetStream
and SharedObjects) and this is where you can attach remote functions or
your own data. Otherwise the class is closed and you can't just assign
new properties like in AS2.
If you're using AS2, then this is a compatibility problem we need to
sort out.
Hope this helps,
- Dave Simmons
Adobe Engineering
-----Original Message-----
From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
[mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of JesterXL
Sent: Thursday, July 06, 2006 10:04 AM
To: flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
Subject: [FlashComm] Server-side ActionScript server call client problem
I'm having problems using client.call for server-side ActionScript. It
works ok in Flash Player 8, but not in Flash Player 9. The cause is the
way
callPrefix works in server-side ActionScript. So, if I have a Lobby
component called "_DEFAULT_" with a method of "setUsername", I'd go:
client.call ( this.callPrefix + "setUsername", null, "someName");
My client-side component would have it's method called IF the same
namespace
is setup on the NetConnection object, like so:
nc["Lobby"] =3D {};
nc["Lobby"]["_DEFAULT_"] =3D this;
function setUsername ( str )
{
}
....however, this dynamic stuff doesn't work in Flash Player 9. You CAN
call
methods; however, they have to be in the public namespace (not protected
or
private), and you can't use callPrefix on the server-side. I've tried a
ton
of things:
- used an anonymous object to forward the method
- extended NetConnection to be dynamic
- strongly typed the namespaces
- used a custom class instead of namespaces
- combination of the above techniques
Nothing works. I'm thinking a quick fix will be to remove callPrefix
from
the server-side ActionScript and instead make it a parameter, and handle
the
namespace routing via the extended client side NetConnection class.
Thoughts? Ideas? Solutions?
--JesterXL
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com=20
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
| |
| JesterXL 2006-07-06, 7:11 pm |
| Weird. The same exact server-side code works in Flash 8, but not in Flash
9, so somehow the slash syntax works in 8, but not 9. I've dug through the
framework, but only see how client calls are mapped via __resolve to cached
functions, not the other way around.
Where tf is Srinivas Manapragada, he'd know I bet...
----- Original Message -----
From: "David Simmons" <dsimmons-dv/VyGpifdQAvxtiuMwx3w@public.gmane.org>
To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
Sent: Thursday, July 06, 2006 2:05 PM
Subject: RE: [FlashComm] Server-side ActionScript server call client problem
I'm taking a guess here, but I think the code must not like the slash as
an invalid character in a property name.
Under the hood, a NetConnection call gets sent from the server to client
with information on what function to call, the parameters and a return
object. The player matches the call() function name to a property with
the same name attached to NetConnection.client. If it finds a match,
and that property is a function pointer, it will call the function.
I'm pretty sure you can't use a property name with the slash in it, and
it's getting stripped out or converted at some stage.
- Dave Simmons
Adobe Engineering
-----Original Message-----
From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
[mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of JesterXL
Sent: Thursday, July 06, 2006 10:51 AM
To: FlashComm Mailing List
Subject: Re: [FlashComm] Server-side ActionScript server call client
problem
....ok, the NetConnection.client works just like the NetConnection does.
As
long as you don't use the callPrefix, you can call methods on either the
NetConnection, or the NetConnection.client object.
What doesn't work is any type of namespacing. How the heck does
client.call
convert the slashes to dot's anyway?
Like, my callPrefix is "Lobby/_DEFAULT_" when I trace it out
server-side.
Hrm........
----- Original Message -----
From: "JesterXL" <jesterxl-RyEax5csP4NCVeB36W80OQ@public.gmane.org>
To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
Sent: Thursday, July 06, 2006 1:18 PM
Subject: Re: [FlashComm] Server-side ActionScript server call client
problem
I found that yesterday for SharedObject, and 2 seconds after I sent the
email, I went to see if NetConnection had it, and lo and behold, he has
it
too!
I'll try that. It already worked for my SharedObject's so I'm sure
it'll
work for NetConnection too.
:: goes to try ::
----- Original Message -----
From: "David Simmons" <dsimmons-dv/VyGpifdQAvxtiuMwx3w@public.gmane.org>
To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
Sent: Thursday, July 06, 2006 1:14 PM
Subject: RE: [FlashComm] Server-side ActionScript server call client
problem
Hey Jester -
I can't tell exactly if you're using AS3, but if so, check out
http://livedocs.macromedia.com/labs...net/NetConnecti
on.html
There is a read/write "client" property on NetConnections (and NetStream
and SharedObjects) and this is where you can attach remote functions or
your own data. Otherwise the class is closed and you can't just assign
new properties like in AS2.
If you're using AS2, then this is a compatibility problem we need to
sort out.
Hope this helps,
- Dave Simmons
Adobe Engineering
-----Original Message-----
From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
[mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of JesterXL
Sent: Thursday, July 06, 2006 10:04 AM
To: flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
Subject: [FlashComm] Server-side ActionScript server call client problem
I'm having problems using client.call for server-side ActionScript. It
works ok in Flash Player 8, but not in Flash Player 9. The cause is the
way
callPrefix works in server-side ActionScript. So, if I have a Lobby
component called "_DEFAULT_" with a method of "setUsername", I'd go:
client.call ( this.callPrefix + "setUsername", null, "someName");
My client-side component would have it's method called IF the same
namespace
is setup on the NetConnection object, like so:
nc["Lobby"] = {};
nc["Lobby"]["_DEFAULT_"] = this;
function setUsername ( str )
{
}
....however, this dynamic stuff doesn't work in Flash Player 9. You CAN
call
methods; however, they have to be in the public namespace (not protected
or
private), and you can't use callPrefix on the server-side. I've tried a
ton
of things:
- used an anonymous object to forward the method
- extended NetConnection to be dynamic
- strongly typed the namespaces
- used a custom class instead of namespaces
- combination of the above techniques
Nothing works. I'm thinking a quick fix will be to remove callPrefix
from
the server-side ActionScript and instead make it a parameter, and handle
the
namespace routing via the extended client side NetConnection class.
Thoughts? Ideas? Solutions?
--JesterXL
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
| |
| JesterXL 2006-07-06, 7:11 pm |
| ....or, maybe is it because "slash-syntax" doesn't work in the new AVM?
----- Original Message -----
From: "David Simmons" <dsimmons-dv/VyGpifdQAvxtiuMwx3w@public.gmane.org>
To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
Sent: Thursday, July 06, 2006 2:05 PM
Subject: RE: [FlashComm] Server-side ActionScript server call client problem
I'm taking a guess here, but I think the code must not like the slash as
an invalid character in a property name.
Under the hood, a NetConnection call gets sent from the server to client
with information on what function to call, the parameters and a return
object. The player matches the call() function name to a property with
the same name attached to NetConnection.client. If it finds a match,
and that property is a function pointer, it will call the function.
I'm pretty sure you can't use a property name with the slash in it, and
it's getting stripped out or converted at some stage.
- Dave Simmons
Adobe Engineering
-----Original Message-----
From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
[mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of JesterXL
Sent: Thursday, July 06, 2006 10:51 AM
To: FlashComm Mailing List
Subject: Re: [FlashComm] Server-side ActionScript server call client
problem
....ok, the NetConnection.client works just like the NetConnection does.
As
long as you don't use the callPrefix, you can call methods on either the
NetConnection, or the NetConnection.client object.
What doesn't work is any type of namespacing. How the heck does
client.call
convert the slashes to dot's anyway?
Like, my callPrefix is "Lobby/_DEFAULT_" when I trace it out
server-side.
Hrm........
----- Original Message -----
From: "JesterXL" <jesterxl-RyEax5csP4NCVeB36W80OQ@public.gmane.org>
To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
Sent: Thursday, July 06, 2006 1:18 PM
Subject: Re: [FlashComm] Server-side ActionScript server call client
problem
I found that yesterday for SharedObject, and 2 seconds after I sent the
email, I went to see if NetConnection had it, and lo and behold, he has
it
too!
I'll try that. It already worked for my SharedObject's so I'm sure
it'll
work for NetConnection too.
:: goes to try ::
----- Original Message -----
From: "David Simmons" <dsimmons-dv/VyGpifdQAvxtiuMwx3w@public.gmane.org>
To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
Sent: Thursday, July 06, 2006 1:14 PM
Subject: RE: [FlashComm] Server-side ActionScript server call client
problem
Hey Jester -
I can't tell exactly if you're using AS3, but if so, check out
http://livedocs.macromedia.com/labs...net/NetConnecti
on.html
There is a read/write "client" property on NetConnections (and NetStream
and SharedObjects) and this is where you can attach remote functions or
your own data. Otherwise the class is closed and you can't just assign
new properties like in AS2.
If you're using AS2, then this is a compatibility problem we need to
sort out.
Hope this helps,
- Dave Simmons
Adobe Engineering
-----Original Message-----
From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
[mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of JesterXL
Sent: Thursday, July 06, 2006 10:04 AM
To: flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
Subject: [FlashComm] Server-side ActionScript server call client problem
I'm having problems using client.call for server-side ActionScript. It
works ok in Flash Player 8, but not in Flash Player 9. The cause is the
way
callPrefix works in server-side ActionScript. So, if I have a Lobby
component called "_DEFAULT_" with a method of "setUsername", I'd go:
client.call ( this.callPrefix + "setUsername", null, "someName");
My client-side component would have it's method called IF the same
namespace
is setup on the NetConnection object, like so:
nc["Lobby"] = {};
nc["Lobby"]["_DEFAULT_"] = this;
function setUsername ( str )
{
}
....however, this dynamic stuff doesn't work in Flash Player 9. You CAN
call
methods; however, they have to be in the public namespace (not protected
or
private), and you can't use callPrefix on the server-side. I've tried a
ton
of things:
- used an anonymous object to forward the method
- extended NetConnection to be dynamic
- strongly typed the namespaces
- used a custom class instead of namespaces
- combination of the above techniques
Nothing works. I'm thinking a quick fix will be to remove callPrefix
from
the server-side ActionScript and instead make it a parameter, and handle
the
namespace routing via the extended client side NetConnection class.
Thoughts? Ideas? Solutions?
--JesterXL
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
| |
| Stefan Richter 2006-07-06, 7:11 pm |
| In any case it sounds like a backwards compatibility issue that would breal
existing apps if I get your drift?
Or are you saying that only new AS3 apps break when you use a slash syntax
but older apps (which presumably run over the old AVM) are ok?
Stefan
> -----Original Message-----
> From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> [mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of JesterXL
> Sent: 06 July 2006 19:17
> To: FlashComm Mailing List
> Subject: Re: [FlashComm] Server-side ActionScript server call
> client problem
>
> ...or, maybe is it because "slash-syntax" doesn't work in the new AVM?
>
> ----- Original Message -----
> From: "David Simmons" <dsimmons-dv/VyGpifdQAvxtiuMwx3w@public.gmane.org>
> To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
> Sent: Thursday, July 06, 2006 2:05 PM
> Subject: RE: [FlashComm] Server-side ActionScript server call
> client problem
>
>
> I'm taking a guess here, but I think the code must not like
> the slash as
> an invalid character in a property name.
>
> Under the hood, a NetConnection call gets sent from the
> server to client
> with information on what function to call, the parameters and a return
> object. The player matches the call() function name to a
> property with
> the same name attached to NetConnection.client. If it finds a match,
> and that property is a function pointer, it will call the function.
>
> I'm pretty sure you can't use a property name with the slash
> in it, and
> it's getting stripped out or converted at some stage.
>
> - Dave Simmons
> Adobe Engineering
>
>
> -----Original Message-----
> From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> [mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of JesterXL
> Sent: Thursday, July 06, 2006 10:51 AM
> To: FlashComm Mailing List
> Subject: Re: [FlashComm] Server-side ActionScript server call client
> problem
>
> ...ok, the NetConnection.client works just like the
> NetConnection does.
> As
> long as you don't use the callPrefix, you can call methods on
> either the
>
> NetConnection, or the NetConnection.client object.
>
> What doesn't work is any type of namespacing. How the heck does
> client.call
> convert the slashes to dot's anyway?
>
> Like, my callPrefix is "Lobby/_DEFAULT_" when I trace it out
> server-side.
>
> Hrm........
>
> ----- Original Message -----
> From: "JesterXL" <jesterxl-RyEax5csP4NCVeB36W80OQ@public.gmane.org>
> To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
> Sent: Thursday, July 06, 2006 1:18 PM
> Subject: Re: [FlashComm] Server-side ActionScript server call client
> problem
>
>
> I found that yesterday for SharedObject, and 2 seconds after
> I sent the
> email, I went to see if NetConnection had it, and lo and
> behold, he has
> it
> too!
>
> I'll try that. It already worked for my SharedObject's so I'm sure
> it'll
> work for NetConnection too.
>
> :: goes to try ::
>
> ----- Original Message -----
> From: "David Simmons" <dsimmons-dv/VyGpifdQAvxtiuMwx3w@public.gmane.org>
> To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
> Sent: Thursday, July 06, 2006 1:14 PM
> Subject: RE: [FlashComm] Server-side ActionScript server call client
> problem
>
>
> Hey Jester -
>
> I can't tell exactly if you're using AS3, but if so, check out
> http://livedocs.macromedia.com/labs...ref/flash/net/N
> etConnecti
> on.html
>
> There is a read/write "client" property on NetConnections
> (and NetStream
> and SharedObjects) and this is where you can attach remote
> functions or
> your own data. Otherwise the class is closed and you can't
> just assign
> new properties like in AS2.
>
> If you're using AS2, then this is a compatibility problem we need to
> sort out.
>
> Hope this helps,
>
> - Dave Simmons
> Adobe Engineering
>
>
> -----Original Message-----
> From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> [mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of JesterXL
> Sent: Thursday, July 06, 2006 10:04 AM
> To: flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> Subject: [FlashComm] Server-side ActionScript server call
> client problem
>
> I'm having problems using client.call for server-side
> ActionScript. It
> works ok in Flash Player 8, but not in Flash Player 9. The
> cause is the
> way
> callPrefix works in server-side ActionScript. So, if I have a Lobby
> component called "_DEFAULT_" with a method of "setUsername", I'd go:
>
> client.call ( this.callPrefix + "setUsername", null, "someName");
>
> My client-side component would have it's method called IF the same
> namespace
> is setup on the NetConnection object, like so:
>
> nc["Lobby"] = {};
> nc["Lobby"]["_DEFAULT_"] = this;
>
> function setUsername ( str )
> {
> }
>
> ...however, this dynamic stuff doesn't work in Flash Player
> 9. You CAN
> call
> methods; however, they have to be in the public namespace
> (not protected
> or
> private), and you can't use callPrefix on the server-side.
> I've tried a
> ton
> of things:
>
> - used an anonymous object to forward the method
> - extended NetConnection to be dynamic
> - strongly typed the namespaces
> - used a custom class instead of namespaces
> - combination of the above techniques
>
> Nothing works. I'm thinking a quick fix will be to remove callPrefix
> from
> the server-side ActionScript and instead make it a parameter,
> and handle
> the
> namespace routing via the extended client side NetConnection class.
>
> Thoughts? Ideas? Solutions?
>
> --JesterXL
>
> ________________________________________
_______
> FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
> ________________________________________
_______
> FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
> ________________________________________
_______
> FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
> ________________________________________
_______
> FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
> ________________________________________
_______
> FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
> ________________________________________
_______
> FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
| |
| JesterXL 2006-07-06, 7:11 pm |
| For existing apps, 2 things will happen:
- it'll detect that the SWF's are Flash Player 8 or below, and use the old
AVM.
- it'll use the old AMF0 decoding
Both of the above ensure backwards compatibility. I've already tested my
old Flashcom apps in Flash Player 9 and they all work.
The only thing I haven't figured out yet is how to get Flashcom server code
to call a method on the client via namespaces in an ActionScript 3 coded app
(still using AMF0 with Flashcom 1.5). You CAN call client methods; I've
tested it, and it works. It just doesn't work with namespaces... yet.
----- Original Message -----
From: "Stefan Richter" <stefan-fMeCE+ULXElEfu+5ix1nRw@public.gmane.org>
To: "'FlashComm Mailing List'" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
Sent: Thursday, July 06, 2006 2:24 PM
Subject: RE: [FlashComm] Server-side ActionScript server call client problem
In any case it sounds like a backwards compatibility issue that would breal
existing apps if I get your drift?
Or are you saying that only new AS3 apps break when you use a slash syntax
but older apps (which presumably run over the old AVM) are ok?
Stefan
> -----Original Message-----
> From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> [mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of JesterXL
> Sent: 06 July 2006 19:17
> To: FlashComm Mailing List
> Subject: Re: [FlashComm] Server-side ActionScript server call
> client problem
>
> ...or, maybe is it because "slash-syntax" doesn't work in the new AVM?
>
> ----- Original Message -----
> From: "David Simmons" <dsimmons-dv/VyGpifdQAvxtiuMwx3w@public.gmane.org>
> To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
> Sent: Thursday, July 06, 2006 2:05 PM
> Subject: RE: [FlashComm] Server-side ActionScript server call
> client problem
>
>
> I'm taking a guess here, but I think the code must not like
> the slash as
> an invalid character in a property name.
>
> Under the hood, a NetConnection call gets sent from the
> server to client
> with information on what function to call, the parameters and a return
> object. The player matches the call() function name to a
> property with
> the same name attached to NetConnection.client. If it finds a match,
> and that property is a function pointer, it will call the function.
>
> I'm pretty sure you can't use a property name with the slash
> in it, and
> it's getting stripped out or converted at some stage.
>
> - Dave Simmons
> Adobe Engineering
>
>
> -----Original Message-----
> From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> [mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of JesterXL
> Sent: Thursday, July 06, 2006 10:51 AM
> To: FlashComm Mailing List
> Subject: Re: [FlashComm] Server-side ActionScript server call client
> problem
>
> ...ok, the NetConnection.client works just like the
> NetConnection does.
> As
> long as you don't use the callPrefix, you can call methods on
> either the
>
> NetConnection, or the NetConnection.client object.
>
> What doesn't work is any type of namespacing. How the heck does
> client.call
> convert the slashes to dot's anyway?
>
> Like, my callPrefix is "Lobby/_DEFAULT_" when I trace it out
> server-side.
>
> Hrm........
>
> ----- Original Message -----
> From: "JesterXL" <jesterxl-RyEax5csP4NCVeB36W80OQ@public.gmane.org>
> To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
> Sent: Thursday, July 06, 2006 1:18 PM
> Subject: Re: [FlashComm] Server-side ActionScript server call client
> problem
>
>
> I found that yesterday for SharedObject, and 2 seconds after
> I sent the
> email, I went to see if NetConnection had it, and lo and
> behold, he has
> it
> too!
>
> I'll try that. It already worked for my SharedObject's so I'm sure
> it'll
> work for NetConnection too.
>
> :: goes to try ::
>
> ----- Original Message -----
> From: "David Simmons" <dsimmons-dv/VyGpifdQAvxtiuMwx3w@public.gmane.org>
> To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
> Sent: Thursday, July 06, 2006 1:14 PM
> Subject: RE: [FlashComm] Server-side ActionScript server call client
> problem
>
>
> Hey Jester -
>
> I can't tell exactly if you're using AS3, but if so, check out
> http://livedocs.macromedia.com/labs...ref/flash/net/N
> etConnecti
> on.html
>
> There is a read/write "client" property on NetConnections
> (and NetStream
> and SharedObjects) and this is where you can attach remote
> functions or
> your own data. Otherwise the class is closed and you can't
> just assign
> new properties like in AS2.
>
> If you're using AS2, then this is a compatibility problem we need to
> sort out.
>
> Hope this helps,
>
> - Dave Simmons
> Adobe Engineering
>
>
> -----Original Message-----
> From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> [mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of JesterXL
> Sent: Thursday, July 06, 2006 10:04 AM
> To: flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> Subject: [FlashComm] Server-side ActionScript server call
> client problem
>
> I'm having problems using client.call for server-side
> ActionScript. It
> works ok in Flash Player 8, but not in Flash Player 9. The
> cause is the
> way
> callPrefix works in server-side ActionScript. So, if I have a Lobby
> component called "_DEFAULT_" with a method of "setUsername", I'd go:
>
> client.call ( this.callPrefix + "setUsername", null, "someName");
>
> My client-side component would have it's method called IF the same
> namespace
> is setup on the NetConnection object, like so:
>
> nc["Lobby"] = {};
> nc["Lobby"]["_DEFAULT_"] = this;
>
> function setUsername ( str )
> {
> }
>
> ...however, this dynamic stuff doesn't work in Flash Player
> 9. You CAN
> call
> methods; however, they have to be in the public namespace
> (not protected
> or
> private), and you can't use callPrefix on the server-side.
> I've tried a
> ton
> of things:
>
> - used an anonymous object to forward the method
> - extended NetConnection to be dynamic
> - strongly typed the namespaces
> - used a custom class instead of namespaces
> - combination of the above techniques
>
> Nothing works. I'm thinking a quick fix will be to remove callPrefix
> from
> the server-side ActionScript and instead make it a parameter,
> and handle
> the
> namespace routing via the extended client side NetConnection class.
>
> Thoughts? Ideas? Solutions?
>
> --JesterXL
>
> ________________________________________
_______
> FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
> ________________________________________
_______
> FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
> ________________________________________
_______
> FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
> ________________________________________
_______
> FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
> ________________________________________
_______
> FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
> ________________________________________
_______
> FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
| |
| Brian Lesser 2006-07-06, 7:11 pm |
| Hi Jesse,
I'm in and out of meeting and wanted to post more on this and framework
thread but can't right now. Peldi got into alternatives that he
discusses and illustrates here:
http://www.peldi.com/fmswiki/index....ting_Techniques
It might not work with as3 but you should be able to get something
working...
Yours truly,
-Brian
JesterXL wrote:
>...ok, the NetConnection.client works just like the NetConnection does. As
>long as you don't use the callPrefix, you can call methods on either the
>NetConnection, or the NetConnection.client object.
>
>What doesn't work is any type of namespacing. How the heck does client.call
>convert the slashes to dot's anyway?
>
>Like, my callPrefix is "Lobby/_DEFAULT_" when I trace it out server-side.
>
>Hrm........
>
>----- Original Message -----
>From: "JesterXL" <jesterxl-RyEax5csP4NCVeB36W80OQ@public.gmane.org>
>To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
>Sent: Thursday, July 06, 2006 1:18 PM
>Subject: Re: [FlashComm] Server-side ActionScript server call client problem
>
>
>I found that yesterday for SharedObject, and 2 seconds after I sent the
>email, I went to see if NetConnection had it, and lo and behold, he has it
>too!
>
>I'll try that. It already worked for my SharedObject's so I'm sure it'll
>work for NetConnection too.
>
>:: goes to try ::
>
>----- Original Message -----
>From: "David Simmons" <dsimmons-dv/VyGpifdQAvxtiuMwx3w@public.gmane.org>
>To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
>Sent: Thursday, July 06, 2006 1:14 PM
>Subject: RE: [FlashComm] Server-side ActionScript server call client problem
>
>
>Hey Jester -
>
>I can't tell exactly if you're using AS3, but if so, check out
>http://livedocs.macromedia.com/labs...net/NetConnecti
>on.html
>
>There is a read/write "client" property on NetConnections (and NetStream
>and SharedObjects) and this is where you can attach remote functions or
>your own data. Otherwise the class is closed and you can't just assign
>new properties like in AS2.
>
>If you're using AS2, then this is a compatibility problem we need to
>sort out.
>
>Hope this helps,
>
> - Dave Simmons
> Adobe Engineering
>
>
>-----Original Message-----
>From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
>[mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of JesterXL
>Sent: Thursday, July 06, 2006 10:04 AM
>To: flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
>Subject: [FlashComm] Server-side ActionScript server call client problem
>
>I'm having problems using client.call for server-side ActionScript. It
>works ok in Flash Player 8, but not in Flash Player 9. The cause is the
>way
>callPrefix works in server-side ActionScript. So, if I have a Lobby
>component called "_DEFAULT_" with a method of "setUsername", I'd go:
>
>client.call ( this.callPrefix + "setUsername", null, "someName");
>
>My client-side component would have it's method called IF the same
>namespace
>is setup on the NetConnection object, like so:
>
>nc["Lobby"] = {};
>nc["Lobby"]["_DEFAULT_"] = this;
>
>function setUsername ( str )
>{
>}
>
>...however, this dynamic stuff doesn't work in Flash Player 9. You CAN
>call
>methods; however, they have to be in the public namespace (not protected
>or
>private), and you can't use callPrefix on the server-side. I've tried a
>ton
>of things:
>
>- used an anonymous object to forward the method
>- extended NetConnection to be dynamic
>- strongly typed the namespaces
>- used a custom class instead of namespaces
>- combination of the above techniques
>
>Nothing works. I'm thinking a quick fix will be to remove callPrefix
>from
>the server-side ActionScript and instead make it a parameter, and handle
>the
>namespace routing via the extended client side NetConnection class.
>
>Thoughts? Ideas? Solutions?
>
>--JesterXL
>
> ________________________________________
_______
>FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
>To change your subscription options or search the archive:
>http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
>Brought to you by Fig Leaf Software
>Premier Authorized Adobe Consulting and Training
>http://www.figleaf.com
>http://training.figleaf.com
> ________________________________________
_______
>FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
>To change your subscription options or search the archive:
>http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
>Brought to you by Fig Leaf Software
>Premier Authorized Adobe Consulting and Training
>http://www.figleaf.com
>http://training.figleaf.com
>
> ________________________________________
_______
>FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
>To change your subscription options or search the archive:
>http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
>Brought to you by Fig Leaf Software
>Premier Authorized Adobe Consulting and Training
>http://www.figleaf.com
>http://training.figleaf.com
>
> ________________________________________
_______
>FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
>To change your subscription options or search the archive:
>http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
>Brought to you by Fig Leaf Software
>Premier Authorized Adobe Consulting and Training
>http://www.figleaf.com
>http://training.figleaf.com
>
>
--
________________________________________
______________________________
Brian Lesser
Assistant Director, Teaching and Technology Support
Computing and Communications Services
Ryerson University
350 Victoria St.
Toronto, Ontario Phone: (416) 979-5000 ext. 6835
M5B 2K3 Fax: (416) 979-5220
Office: AB48D E-mail: blesser-6s6ziW1YCwCw5LPnMra/2Q@public.gmane.org
(Enter through LB66) Web: http://www.ryerson.ca/~blesser
________________________________________
______________________________
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
| |
| JesterXL 2006-07-07, 1:11 am |
| Thanks G!
I gave up. It seems to me that the callPrefix:
"Component/Instance/" + "methodName"
Was somehow getting translated into an actual method call via slash syntax.
That's the only thing I can think of. However, that and prefix:
"Component.Instance." + "methodName"
Do not work, no matter what I tried client & server-side.
I've just decided to send the prefix as the first parameter to all server to
client messages instead of prefixing the method with it. Since you can map
the NetConnection's client property to a class, that Observer basically can
parse out the prefix and emit the appropriate events. It's really not that
big of a deal since I have like 4 total server to client calls in 8 of my
server-side components. I was just wanted to know WHY the heck it can't map
like Flash Player 8 did, but don't have the patience for such trivial
things. The code works, and working code makes me happy!
----- Original Message -----
From: "Brian Lesser" <blesser-6s6ziW1YCwCw5LPnMra/2Q@public.gmane.org>
To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
Sent: Thursday, July 06, 2006 2:29 PM
Subject: Re: [FlashComm] Server-side ActionScript server call client problem
Hi Jesse,
I'm in and out of meeting and wanted to post more on this and framework
thread but can't right now. Peldi got into alternatives that he
discusses and illustrates here:
http://www.peldi.com/fmswiki/index....ting_Techniques
It might not work with as3 but you should be able to get something
working...
Yours truly,
-Brian
JesterXL wrote:
>...ok, the NetConnection.client works just like the NetConnection does. As
>long as you don't use the callPrefix, you can call methods on either the
>NetConnection, or the NetConnection.client object.
>
>What doesn't work is any type of namespacing. How the heck does
>client.call
>convert the slashes to dot's anyway?
>
>Like, my callPrefix is "Lobby/_DEFAULT_" when I trace it out server-side.
>
>Hrm........
>
>----- Original Message -----
>From: "JesterXL" <jesterxl-RyEax5csP4NCVeB36W80OQ@public.gmane.org>
>To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
>Sent: Thursday, July 06, 2006 1:18 PM
>Subject: Re: [FlashComm] Server-side ActionScript server call client
>problem
>
>
>I found that yesterday for SharedObject, and 2 seconds after I sent the
>email, I went to see if NetConnection had it, and lo and behold, he has it
>too!
>
>I'll try that. It already worked for my SharedObject's so I'm sure it'll
>work for NetConnection too.
>
>:: goes to try ::
>
>----- Original Message -----
>From: "David Simmons" <dsimmons-dv/VyGpifdQAvxtiuMwx3w@public.gmane.org>
>To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
>Sent: Thursday, July 06, 2006 1:14 PM
>Subject: RE: [FlashComm] Server-side ActionScript server call client
>problem
>
>
>Hey Jester -
>
>I can't tell exactly if you're using AS3, but if so, check out
>http://livedocs.macromedia.com/labs...net/NetConnecti
>on.html
>
>There is a read/write "client" property on NetConnections (and NetStream
>and SharedObjects) and this is where you can attach remote functions or
>your own data. Otherwise the class is closed and you can't just assign
>new properties like in AS2.
>
>If you're using AS2, then this is a compatibility problem we need to
>sort out.
>
>Hope this helps,
>
> - Dave Simmons
> Adobe Engineering
>
>
>-----Original Message-----
>From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
>[mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of JesterXL
>Sent: Thursday, July 06, 2006 10:04 AM
>To: flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
>Subject: [FlashComm] Server-side ActionScript server call client problem
>
>I'm having problems using client.call for server-side ActionScript. It
>works ok in Flash Player 8, but not in Flash Player 9. The cause is the
>way
>callPrefix works in server-side ActionScript. So, if I have a Lobby
>component called "_DEFAULT_" with a method of "setUsername", I'd go:
>
>client.call ( this.callPrefix + "setUsername", null, "someName");
>
>My client-side component would have it's method called IF the same
>namespace
>is setup on the NetConnection object, like so:
>
>nc["Lobby"] = {};
>nc["Lobby"]["_DEFAULT_"] = this;
>
>function setUsername ( str )
>{
>}
>
>...however, this dynamic stuff doesn't work in Flash Player 9. You CAN
>call
>methods; however, they have to be in the public namespace (not protected
>or
>private), and you can't use callPrefix on the server-side. I've tried a
>ton
>of things:
>
>- used an anonymous object to forward the method
>- extended NetConnection to be dynamic
>- strongly typed the namespaces
>- used a custom class instead of namespaces
>- combination of the above techniques
>
>Nothing works. I'm thinking a quick fix will be to remove callPrefix
>from
>the server-side ActionScript and instead make it a parameter, and handle
>the
>namespace routing via the extended client side NetConnection class.
>
>Thoughts? Ideas? Solutions?
>
>--JesterXL
>
> ________________________________________
_______
>FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
>To change your subscription options or search the archive:
>http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
>Brought to you by Fig Leaf Software
>Premier Authorized Adobe Consulting and Training
>http://www.figleaf.com
>http://training.figleaf.com
> ________________________________________
_______
>FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
>To change your subscription options or search the archive:
>http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
>Brought to you by Fig Leaf Software
>Premier Authorized Adobe Consulting and Training
>http://www.figleaf.com
>http://training.figleaf.com
>
> ________________________________________
_______
>FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
>To change your subscription options or search the archive:
>http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
>Brought to you by Fig Leaf Software
>Premier Authorized Adobe Consulting and Training
>http://www.figleaf.com
>http://training.figleaf.com
>
> ________________________________________
_______
>FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
>To change your subscription options or search the archive:
>http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
>Brought to you by Fig Leaf Software
>Premier Authorized Adobe Consulting and Training
>http://www.figleaf.com
>http://training.figleaf.com
>
>
--
________________________________________
______________________________
Brian Lesser
Assistant Director, Teaching and Technology Support
Computing and Communications Services
Ryerson University
350 Victoria St.
Toronto, Ontario Phone: (416) 979-5000 ext. 6835
M5B 2K3 Fax: (416) 979-5220
Office: AB48D E-mail: blesser-6s6ziW1YCwCw5LPnMra/2Q@public.gmane.org
(Enter through LB66) Web: http://www.ryerson.ca/~blesser
________________________________________
______________________________
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
| |
| Stefan Richter 2006-07-07, 7:11 am |
| Hey Jesse,
I haven't played with AS3 yet (not much anyway) and I'd like to know how the
mapping of a Netconnection client property to a class works?
Can you post some sort of brief example snippet?
Thx
Stefan
> -----Original Message-----
> From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> [mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of JesterXL
> Sent: 07 July 2006 05:29
> To: FlashComm Mailing List
> Subject: Re: [FlashComm] Server-side ActionScript server call
> client problem
>
> Thanks G!
>
> I gave up. It seems to me that the callPrefix:
>
> "Component/Instance/" + "methodName"
>
> Was somehow getting translated into an actual method call via
> slash syntax.
> That's the only thing I can think of. However, that and prefix:
>
> "Component.Instance." + "methodName"
>
> Do not work, no matter what I tried client & server-side.
>
> I've just decided to send the prefix as the first parameter
> to all server to client messages instead of prefixing the
> method with it. Since you can map the NetConnection's client
> property to a class, that Observer basically can parse out
> the prefix and emit the appropriate events. It's really not
> that big of a deal since I have like 4 total server to client
> calls in 8 of my server-side components. I was just wanted
> to know WHY the heck it can't map like Flash Player 8 did,
> but don't have the patience for such trivial things. The
> code works, and working code makes me happy!
>
> ----- Original Message -----
> From: "Brian Lesser" <blesser-6s6ziW1YCwCw5LPnMra/2Q@public.gmane.org>
> To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
> Sent: Thursday, July 06, 2006 2:29 PM
> Subject: Re: [FlashComm] Server-side ActionScript server call
> client problem
>
>
> Hi Jesse,
> I'm in and out of meeting and wanted to post more on this and
> framework
> thread but can't right now. Peldi got into alternatives that he
> discusses and illustrates here:
>
> http://www.peldi.com/fmswiki/index....fferent_Compone
> nt_Method-Routing_Techniques
>
> It might not work with as3 but you should be able to get something
> working...
> Yours truly,
> -Brian
>
> JesterXL wrote:
>
> NetConnection does. As
> on either the
> server-side.
> I sent the
> behold, he has it
> I'm sure it'll
> NetConnecti
> (and NetStream
> functions or
> just assign
> Of JesterXL
> client problem
> ActionScript. It
> cause is the
> 9. You CAN
> (not protected
> I've tried a
> parameter, and handle
>
>
> --
> ________________________________________
______________________________
> Brian Lesser
> Assistant Director, Teaching and Technology Support
> Computing and Communications Services
> Ryerson University
> 350 Victoria St.
> Toronto, Ontario Phone: (416) 979-5000 ext. 6835
> M5B 2K3 Fax: (416) 979-5220
> Office: AB48D E-mail: blesser-6s6ziW1YCwCw5LPnMra/2Q@public.gmane.org
> (Enter through LB66) Web: http://www.ryerson.ca/~blesser
> ________________________________________
______________________________
>
> ________________________________________
_______
> FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
> ________________________________________
_______
> FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
| |
| JesterXL 2006-07-07, 1:12 pm |
| It's a long description. Basically, when you make a client to server, and
server to client works about the same way.
When you make a call to the server via nc.call, FCS looks for that method on
the client. The Component Framework takes over from there and creates the
methods on the Client object. However, there is no "component framework"
equivalent on the client, so you must do it manually. Basically, it goes
like this:
// Client
fcsClassName = "Lobby";
fcsInstanceName = "_DEFAULT_"; // or component name
prefix = fcsClassName + "." + fcsInstanceName + ".";
nc.call ( prefix + "setUsername", null, "JesterXL");
// Server pseudo code
function __resolve( method ) // for the client
{
if the method does not exist
create it
store on Client object
when it's called again, it'll go faster
}
So, you're client object will actually have something like this:
Client["Lobby"]["_DEFAULT_"].setUsername = function(s){ // suff};
Now, that's all handled behind the scense. However, you'll notice above
that I had to make the prefix for the client myself? You have to do the
same thing that the server does to clients for your NetConnection. So:
// Server
this.callPrefix = "Lobby/_DEFAULT_/";
client.call ( this.callPrefix + "setUsername", null, "JesterXL");
// Client pseudo code
nc["Lobby"] = {};
nc["Lobby"]["_DEFAULT_"] = this;
function setUsername(str)
{
// stuff
}
The reason setUsername in your component on the client can get fired is
somehow, behind the scenes on FCS ( I mean like, actually in the Flash
Player itself), "Lobby/_DEFAULT_/" is mapped to
"_level0.yourApp.yourComponent" and then the setUsername function is run.
The above server to client works in Flash Player 8, but not Flash Player 9.
----- Original Message -----
From: "Stefan Richter" <stefan-fMeCE+ULXElEfu+5ix1nRw@public.gmane.org>
To: "'FlashComm Mailing List'" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
Sent: Friday, July 07, 2006 3:40 AM
Subject: RE: [FlashComm] Server-side ActionScript server call client problem
Hey Jesse,
I haven't played with AS3 yet (not much anyway) and I'd like to know how the
mapping of a Netconnection client property to a class works?
Can you post some sort of brief example snippet?
Thx
Stefan
> -----Original Message-----
> From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> [mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of JesterXL
> Sent: 07 July 2006 05:29
> To: FlashComm Mailing List
> Subject: Re: [FlashComm] Server-side ActionScript server call
> client problem
>
> Thanks G!
>
> I gave up. It seems to me that the callPrefix:
>
> "Component/Instance/" + "methodName"
>
> Was somehow getting translated into an actual method call via
> slash syntax.
> That's the only thing I can think of. However, that and prefix:
>
> "Component.Instance." + "methodName"
>
> Do not work, no matter what I tried client & server-side.
>
> I've just decided to send the prefix as the first parameter
> to all server to client messages instead of prefixing the
> method with it. Since you can map the NetConnection's client
> property to a class, that Observer basically can parse out
> the prefix and emit the appropriate events. It's really not
> that big of a deal since I have like 4 total server to client
> calls in 8 of my server-side components. I was just wanted
> to know WHY the heck it can't map like Flash Player 8 did,
> but don't have the patience for such trivial things. The
> code works, and working code makes me happy!
>
> ----- Original Message -----
> From: "Brian Lesser" <blesser-6s6ziW1YCwCw5LPnMra/2Q@public.gmane.org>
> To: "FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
> Sent: Thursday, July 06, 2006 2:29 PM
> Subject: Re: [FlashComm] Server-side ActionScript server call
> client problem
>
>
> Hi Jesse,
> I'm in and out of meeting and wanted to post more on this and
> framework
> thread but can't right now. Peldi got into alternatives that he
> discusses and illustrates here:
>
> http://www.peldi.com/fmswiki/index....fferent_Compone
> nt_Method-Routing_Techniques
>
> It might not work with as3 but you should be able to get something
> working...
> Yours truly,
> -Brian
>
> JesterXL wrote:
>
> NetConnection does. As
> on either the
> server-side.
> I sent the
> behold, he has it
> I'm sure it'll
> NetConnecti
> (and NetStream
> functions or
> just assign
> Of JesterXL
> client problem
> ActionScript. It
> cause is the
> 9. You CAN
> (not protected
> I've tried a
> parameter, and handle
>
>
> --
> ________________________________________
______________________________
> Brian Lesser
> Assistant Director, Teaching and Technology Support
> Computing and Communications Services
> Ryerson University
> 350 Victoria St.
> Toronto, Ontario Phone: (416) 979-5000 ext. 6835
> M5B 2K3 Fax: (416) 979-5220
> Office: AB48D E-mail: blesser-6s6ziW1YCwCw5LPnMra/2Q@public.gmane.org
> (Enter through LB66) Web: http://www.ryerson.ca/~blesser
> ________________________________________
______________________________
>
> ________________________________________
_______
> FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
> ________________________________________
_______
> FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
|
|
|
|
|