Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ajax and Flash

 
Fran�ois De Grandi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What would be the advantages of processing data with Ajax to and from a Flash embedded object in the HTML page, instead of using Flex or Lazlo technologies ?
 
Neerav Narielwala
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it would be much simpler..
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Neerav Narielwala:
I think it would be much simpler..


where we consider your reply ? mean in above question
 
Kris Hadlock
Author
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
FDG,

You could always use the send, load and sendandload methods in Flash to accomplish server-side integration as well. In terms of using Ajax, I wrote an article for InformIT about using the ExternalInterface to communicate with Ajax, you can check it out here.

The issue with these options is that you cannot transfer objects easily, rather you would need to serialize them as XML or JSON. With that said, you can still accomplish some powerful data transfers with the options listed above. It all depends on what you are looking to do.
 
Fran�ois De Grandi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kris,

Thank you very much for the precious hints about JSON. I have tapped into your articles, and I will now explore the options of using JS Objects in that manner.

The only link that I do not see clearly yet is the Server Side of the process :

- I am building a WebApp with Ruby on Rails, which stores data for estimating House Remodeling Costs (Measurements, Unit prices etc.) : the user inputs the measurements of the rooms (e.g. building elements) she needs to remodel, ideally with a visual interface (that's the reason for the use of Flash), and the App (Server and/or Client) calculates the resulting costs (Unit prices are fed via another 'back-office-modelUpdating interface)

- now how do I generate/serialize JSON data on the Server side to send back to be de-serialized on the Client side ? I suppose I can write parsing code for my Ruby-ServerObjects (which are connected to the MySql database) : I just need some hints about pitfalls to avoid and Best Practice essentials in that matter

Thank you again,

FDG
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic