I’m trying to call a function from an AS3 application with the following signature
public void onPasswordChanged(IClient client, RequestFunction function, AMFDataList params)
But when I call this from the client, it seems the parameters are not retrievable. My AS3 code is as follows
/* JS callback functions */
public function setPassword(pw:String):void
{
trace(printf("setPassword called: %s is new password", pw));
this.roomPassword = pw;
serverCall('onPasswordChanged', this.streamName, this.roomPassword);
}
private function serverCall(func:String, ...params):void
{
try {
if ( nc.connected ) {
nc.call(func, null, params);
}
} catch ( e:Error ) {
trace( "Server Error: "+e.toString() );
}
}
On the client, the trace() shows that my params are there. But calling getString(params, PARAM1) on the server returns null, and calling params.getString(PARAM1) results in “19:31:55: ERROR -Category: server -Event: comment -Comment: invoke(onPasswordChanged): java.lang.ClassCastException: com.wowza.wms.amf.AMFDataMixedArray cannot be cast to com.wowza.wms.amf.AMFDataItem: com.wowza.wms.amf.AMFDataList.getString(null:-1)”
What could possibly be wrong here?