Mike Chambers

code = joy

ActionScript 3 MySQL library

with 18 comments

One of the questions that comes up around Apollo is whether it will have built in support for connecting directly to databases, such as MySQL. We are not building in native support for connecting directly to external databases, but it is possible for someone to write ActionScript libraries to connect directly to the database.

Well, Matt MacLean has been doing just that, and has released an Alpha version of an ActionScript 3 library for connecting to and communicating directly with MySQL. This could turn out to be a very useful library, especially if you are building Apollo applications that need to connect directly to locally installed databases.

You can find more information on the project, as well as download code and samples from here.

Written by mikechambers

May 7th, 2007 at 10:39 pm

Posted in General

18 Responses to 'ActionScript 3 MySQL library'

Subscribe to comments with RSS or TrackBack to 'ActionScript 3 MySQL library'.

  1. awesome, thanks!

    julien

    8 May 07 at 12:47 am

  2. maliboo

    8 May 07 at 1:14 am

  3. Yeah, We need to think about doing this as one project :)

    mooska

    8 May 07 at 1:32 am

  4. [...] to a MySQL database from AS3, removing the need for a middle layer such as remoting or XML. As Mike Chambers points out, this could be extremely useful for Apollo applications which won’t be able to use PHP locally to [...]

  5. This is a great! With the addition of binary sockets in AS3 this makes this kind of “socket” programming a lot easier. My only issue is with security. Since after all the SWF file is an open format that can be reversed, having a lot of database information there can be a serious security risk. Any thoughs on how in the future this might be addressed. Cheers! :D

    Samuel Agesilas

    8 May 07 at 7:43 am

  6. It’s great!!! It would be very useful to avoid middleware (JSP, PHP,… script code) at server-side.

    Is it possible? Anybody as try it?

    My only issue, the same as Samuel, is about security. As in Webservices field there are specifications such as WS-Policy… it would be very useful to have the same here.

    Cheers!
    P.D.: Answers are welcome ;-)

    mlinaje

    8 May 07 at 11:09 am

  7. I would not recommend using this to connect directly from a web client / app to the database. In that case, you should go through middleware.

    I think this is most useful when running on a local desktop via Apollo in a known, and secure environment.

    mike chambers

    mesh@adobe.com

    mikechambers

    8 May 07 at 11:15 am

  8. @Samuel, one way around that problem may be to store the sensitive information in a separate file, call the file at runtime and inject values into the variables dynamically. This way, someone would have to be sniffing and intercepting your packets, or get access to the user’s machine and start poking memory addresses. Both are possible, but highly unlikely in my opinion and, at that point, nothing you do will keep an intruder out. As long as the file storing the sensitive info is not accessible to the outside world, you should be alright. I realize, of course, that this isn’t bullet-proof, but it is better than hard-coding the values in the app itself. I can share code examples if you’d like.

    Bryan Bartow

    8 May 07 at 1:35 pm

  9. Theres no one you can prevent from getting login/pass, if something will be visible for the player, then you can get it one way or another. You could obfuscate the code, or try to hide the data, but it will be accessible anyway.

    mooska

    8 May 07 at 2:36 pm

  10. [...] Mike Chambers » Blog Archive » ActionScript 3 MySQL library (tags: tbt flash lex as3 sql mysql driver) [...]

  11. با سلام تصا وير را ارسال نماييد

    mohammadali

    9 May 07 at 8:04 am

  12. [...] = AS3 Class to Connect to MySQL Catching up on some blogs, I ran into a post from Mike Chambers about a new ActionScript class that enables Flash to make direct connections to [...]

  13. Quite impressive.Does it mean Adobe is going to provide methods for direct db connection ?

    Ashwinee

    9 May 07 at 10:10 pm

  14. PÅ™ipojení k MySQL z FLASH…

    Matt MacLean napsal a publikoval ActionScriptovou knihovnu asSQL , která slouží pro připojení k MySQL databázi.

    Dev::Info

    10 May 07 at 12:47 pm

  15. “Both are possible, but highly unlikely in my opinion”

    @Bryan, please don’t take this wrong, but highly unlikely is probably what the developers as MS were thinking as they lefft hole in the OS open. The difference between using a direct connection and using middleware is that with middleware all db access is on the server so the credentials are never sent through the wire.

    What you were recommending is a security measure based on per-connection. Once the file is loaded and the connection is made you have exactly the same security hole that you would have if you wrote the credentials into the swf.

    This is a very cool lib though, and I think a fantastic starting point to further develop from. Congrats guys.

    -Julian

    Julian Sander

    11 May 07 at 1:21 am

  16. [...] I read this on Mike Chambers Blog a actionscript Library to link mySQL with your application so you can link up to a database [...]

  17. [...] Via Mike Chambers Blog [...]

  18. I have put up a new release on google code.

    http://assql.googlecode.com

    Matt

    19 Jul 07 at 4:29 am

Leave a Reply