Calling plain Java classes methods?
"Cristiano Monteiro dos Santos" <[email protected]>
| Newsgroups | gmane.comp.java.openamf.user |
|---|---|
| Message-ID | <[email protected]> |
Hi guys.
Is there any way of calling plain Java classes methods using OpenAMF? I'm trying it here but it doesn't seems to work. I have a plain class called TesteAmf which contains a method called mandaOi, like bellow:
-----------
package atech.teste.amf;
import java.util.Calendar;
public class TesteAmf {
public String mandaOi( String nome ) {
return "Oi " + nome + ". Agora sao " + Calendar.getInstance().get( Calendar.HOUR_OF_DAY ) + ":" + Calendar.getInstance().get( Calendar.MINUTE );
}
}
----------
Then I have my little Flash movie that only calls that method, using that script:
-------------
#include "NetServices.as"
#include "DataGlue.as"
import mx.controls.TextInput;
if ( initialized == null ) {
initialized = true;
NetServices.setDefaultGatewayUrl( "http://localhost:8080/teste_amf/gateway" );
conexao = NetServices.createGatewayConnection();
}
var TesteAmf = conexao.getService( "atech.teste.amf.TesteAmf", this );
btn_envia.onRelease = function() {
TesteAmf.mandaOi( "frango" );
}
function mandaOi_Result( resultado ) {
resultado.text = resultado;
}
function mandaOi_Status( erro ) {
resultado.text = erro.description;
}
--------------
Is there any error that I can't see?
Thanks guys.
Regards,
Cristiano
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8