How do you catch remote FMS method calls with complex prefixes?

Apparently there is no way.

The way to catch server-side Flash Media Server client.call() calls with complex prefixes is not documented. The Flex2 NetConnection docs say that NetConnection.client can be used to catch server-side calls but a call with slashes (as used for the components shipped with FMS) is not documented.

For instance, the cursor.asc server-side component calls:
client.call( this.callPrefix + “attachYourself”, null, clocal.id, cglobal.username, this.layer, cglobal.usercolor);
where this.callPrefix is by default “FCCursor/_DEFAULT_/” so the full call is “FCCursor/_DEFAULT_/attachYourself”.
In AS2 this could be caught by the object in:
netConnection["FCCursor"]["_DEFAULT_"]

The obvious place to catch it in AS3 would be:
netConnection.client["FCCursor"]["_DEFAULT_"] but this does not seem to work.

The LiveDocs also have a comment which asks this same question but the answer is not sufficient.

The only way to work around this seems to make the prefix a parameter in the call instead of prefixing the function name. This takes changing server-side and client-side code and the server code is no longer backwards compatible…..but at least it works.

I have a bug open at Adobe for this one too: FLEXDOCS-94.

Update: The bug has been answered. Slash syntax is, indeed, not supported in AS3.

Tags: , ,

Leave a Reply