Web Hosting Talk







View Full Version : AJAX vs. Flash/Java


schooglepets
05-24-2006, 12:01 AM
I have been building a browser based poker game with a combination of flash and java (for the server). I just had a thought though, I am wondering if AJAX could do the job better by way of security and how many users it could handle online at a time. Does anyone have an opinion on this?

stdunbar
05-24-2006, 01:31 PM
AJAX is not, in and of itself, a display technology like Flash is. It still has to work with HTML/CSS to implment your display components. What it does do is add greater interactivity to the components.

What kind of communication does your Flash client do with the Java server? Is it HTTP or a raw socket? AJAX will force you down the HTTP route which may actually be good - most firewalls block raw socket communication anyhow. But the server side technology shouldn't be affected by a change in the client side display.

Honestly the biggest issue I'd see is that the tools that currently exist for setting up an AJAX client aren't as strong as the Flash tools. That's not to say it can't be done. But I'd say Flash has an edge here.

pnorilsk
05-24-2006, 03:45 PM
AJAX will force you down the HTTP route which may actually be good - most firewalls block raw socket communication anyhow.
It does, thus the number of HTTP requests for the same amount of work will grow up exponentially. So, as a general case, it will need better hardware and app server component.

Peter.

schooglepets
05-24-2006, 04:57 PM
AJAX is not, in and of itself, a display technology like Flash is. It still has to work with HTML/CSS to implment your display components. What it does do is add greater interactivity to the components.

What kind of communication does your Flash client do with the Java server? Is it HTTP or a raw socket? AJAX will force you down the HTTP route which may actually be good - most firewalls block raw socket communication anyhow. But the server side technology shouldn't be affected by a change in the client side display.

Honestly the biggest issue I'd see is that the tools that currently exist for setting up an AJAX client aren't as strong as the Flash tools. That's not to say it can't be done. But I'd say Flash has an edge here.

The graphics needed for this could be done in html/css just as easily in flash the way I have it setup. With flash/java it is a socket server, though I would be doing it through socket 80 on a different IP so that it wouldn't interfere with firewalls. The only thing I am wondering about is would AJAX cause a memory leak in the browser? I originally made the poker game with just flash and an updating http connection every 3 seconds, which crashed any browser after about 15 or 20 minutes, but I don't know if this same thing would happen with AJAX.

quesera
05-25-2006, 01:55 PM
I would choose the Flash/Java combination for this. Ajax isnt suitable for this.

schooglepets
05-25-2006, 05:07 PM
I would choose the Flash/Java combination for this. Ajax isnt suitable for this.

How would it not be? It would use the exact same concept as something like an AJAX/PHP chat system.

shockuk
05-26-2006, 03:05 PM
I would personally use Flash, although there are obviously pros and cons for each method.

Are you stronger in ActionScript or Javascript? They're pretty similar, but still different enough that you'll be better in one than the other. That could be a main decision maker.

I feel that it would be a helluva lot easier to achieve in Flash, but this may be bias because Iv'e been using Flash for over a year, and have only touched the basics of AJAX.

Burhan
05-27-2006, 03:12 AM
The functionality you would get with AJAX would be limited to how good CSS support the client browser has, also interactivity would be limited because there is only so much you can do with dragging divs, etc.

I think flash would be a better solution.

schooglepets
05-27-2006, 03:15 AM
The functionality you would get with AJAX would be limited to how good CSS support the client browser has, also interactivity would be limited because there is only so much you can do with dragging divs, etc.

I think flash would be a better solution.


Why would I need dragging divs? It would just need to update the data displayed on the screen, nothing would have to be dragged or moved, just updated.

Burhan
05-27-2006, 03:17 AM
I assumed you would be using AJAX to run the game, not just for doing the data backhaul.

schooglepets
05-27-2006, 03:33 AM
No, it would just get the updated data and display it to the user, do you think this would be any better than doing basically the same thing with flash?