Register to reply

Ajax vs. Flash

by Ronnin
Tags: ajax, flash
Share this thread:
Ronnin
#1
Feb6-08, 11:00 AM
P: 208
I have been playing around with a couple projects of mine on again, off again for about a year now. I was thinking of dabbling with some client side applications and wanted to get some personal opinions from anyone who has used Flash or Ajax. Can anyone give me some insight if they have had to choose between the two. Most of my applications are pretty generic DB front ends that I have used either, VB, C#, or a Java applet, but I have found myself about Flash w/ Actionscript. Any thoughts?
Phys.Org News Partner Science news on Phys.org
Sapphire talk enlivens guesswork over iPhone 6
Geneticists offer clues to better rice, tomato crops
UConn makes 3-D copies of antique instrument parts
mgb_phys
#2
Feb6-08, 01:29 PM
Sci Advisor
HW Helper
P: 8,954
They are fundementally failry different things.
Flash creates a self contained program downloaded and run in the browser.
Ajax is a set of techniques for allowing a web page to communicate back and forth to the server as parts of the page change.
Think of flash as more a replacement for a Java applet.

You can use Flash to stream content into a page, called Asynchronous Flash - and marketed as Ajax/Flash but it isn't really the same thing.
If you are prepared to target windows only and don't mind being on the cutting edge your could look at silverlight - this is MS's competitor to Flash which lets you run a limited .Net app inside a browser.
-Job-
#3
Feb8-08, 01:02 PM
Sci Advisor
-Job-'s Avatar
P: 1,132
Flash and Javascript/Ajax share many of the same capabilities (and actually had the same syntax as well, in Actionscript 1).

Flash is widely available but a good rule of thumb is: if it can be done with javascript with good performance then use javascript. I would use Flash for drawing vector images, and manipulating audio/graphics. Flash 8 added some great image manipulation capabilities (e.g. you can specify matrix transformations to produce your own image effects/filters in real time).

Multimedia in general should be done with Flash (or Silverlight when it gets there).

In addition Flash has sockets - a very valuable resource. With flash sockets you can implement a stateful connection (i.e. where as in Ajax you have to query the server every x seconds, in Flash you can create a socket connection and have the server send data to the client whenever it needs to, there's two-way communication). There are some reverse-ajax frameworks that enable you to implement more socket-like connections in ajax - but these have some drawbacks.

Java applets i would only use for some extreme needs (such as accessing the user's file system, hardware devices, or for cross-domain socket connections) because the JRE is a big download, and because even for some quite simple tasks you end up having to sign your JAR's, which generates certificate prompts and security warnings. Also two-way java to javascript communication is not the easiest thing to implement - same goes for dynamically adding java applets to html pages with javascript. Finally, there isn't great compatibility between JRE versions - something that works in 1.4.1 does not always work in 1.5 (from my experience).

Ronnin
#4
Feb8-08, 01:49 PM
P: 208
Ajax vs. Flash

Job,
Thanks, that is some good input. I wasn't aware of the sockets in flash and I have a couple of applications in Java that make use of them. Good things to consider.
=CIA= h1tman
#5
Feb8-08, 09:08 PM
P: 7
Flash is very similar to Ajax, but one notable difference is that Flash loads slowly, while Ajax is better optimized for page use. (In my opinion)
-Job-
#6
Feb8-08, 09:59 PM
Sci Advisor
-Job-'s Avatar
P: 1,132
Quote Quote by =CIA= h1tman View Post
Flash is very similar to Ajax, but one notable difference is that Flash loads slowly, while Ajax is better optimized for page use. (In my opinion)
What?!
CaptainQuasar
#7
Feb8-08, 10:15 PM
P: 705
Quote Quote by =CIA= h1tman View Post
Flash is very similar to Ajax, but one notable difference is that Flash loads slowly, while Ajax is better optimized for page use. (In my opinion)
Yeah, that statement really doesn't make sense.
=CIA= h1tman
#8
Feb8-08, 10:18 PM
P: 7
I meant page use as in webapps and such...sorry if it was misinterpreted. I just think Ajax works better for those types of applications.
CaptainQuasar
#9
Feb8-08, 10:43 PM
P: 705
Where besides web applications would you use Ajax and Flash?

I think the confusing thing was that you said that they're similar things, where one is a software product and the other is a programming technique. And it doesn't make sense to say that a programming technique is “optimized”.
=CIA= h1tman
#10
Feb8-08, 10:47 PM
P: 7
You're right, I didn't word that very well, sorry about that.
-Job-
#11
Feb8-08, 11:34 PM
Sci Advisor
-Job-'s Avatar
P: 1,132
Not to mention that you can load flash asynchronously in layers or components, so load time between Ajax and Flash driven applications is not independent of implementation. One isn't better than the other in that aspect by default - it will vary according to the application and its implementation.


Register to reply

Related Discussions
AJAX versus JAVA Computing & Technology 45
Ajax problem Programming & Computer Science 1
Ajax Problem Programming & Computer Science 15
Flash help Computing & Technology 3
Ajax in this forum Forum Feedback & Announcements 3