PDA

View Full Version : Multiplayer+Flash+Java+NetBeans+Debugging+Policy Files


jorgedbucaran
02-29-2008, 02:49 PM
Hello all,

I am building a small Simple Server in Java (taken from the Adobe Labs documentation)

I am debugging it, and I must say I am pretty much satisfied with the dynamics. OK, so first thing, I am able to send data to the server, this I can check from the NetBeans IDE console window because it prints out the received message.

However I am unable to receive data back, in other words the DataEvent.DATA event never gets called even though I do write to the socket from Java.

In short, it is simply never called when debugging, it does not work either when I compile the movie and run it with Flash Player 9 from my computer or from an internet browser, however in the last case, when running from my computer with Flash Player 9 and debugging from NetBeans the data that is actually sent to the Java application is

"<policy-file-request/>" + the null character. (great I got that ;D)

And finally gives this error:

Error: Error #2002: Operation attempted on invalid socket.
at flash.net::XMLSocket/send()
at FlashSocketsDemo_fla::MainTimeline/closeButton_Click()

So first I need to understand what is going on and finally then how to solve it so I can debug my application.

Enlight me please,
J

jorgedbucaran
02-29-2008, 03:33 PM
Does Flash sends a policy file automatically or something?

Because I am not sending a Policy File.

jorgedbucaran
02-29-2008, 03:38 PM
What should I do? Send a policy file? to Java? I thought you only sent policy files between SWF applications.

jorgedbucaran
03-03-2008, 02:11 AM
What pisses me off is that I don't know what to do.

I can't find any decent tutorial on this.

Documentation is good but does not provide runnable examples to test.

I come to a Flash/AS3 forum and none knows the solution.

Is there anybody outthere that knows how to make multiplayer games in Flash? (No Red5crap, SFS, Electro, your own Java server...)

fentunfont
03-18-2008, 06:27 AM
you need to research socket connections for Java.