ActionScript 3 MySQL library

mikechambers May 7th, 2007

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.

18 Responses to “ActionScript 3 MySQL library”

  1. julienon 08 May 2007 at 12:47 am

    awesome, thanks!

  2. malibooon 08 May 2007 at 1:14 am

    Check also: http://asql.mooska.pl/

  3. mooskaon 08 May 2007 at 1:32 am

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

  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. Samuel Agesilason 08 May 2007 at 7:43 am

    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

  6. mlinajeon 08 May 2007 at 11:09 am

    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 ;-)

  7. mikechamberson 08 May 2007 at 11:15 am

    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

  8. Bryan Bartowon 08 May 2007 at 1:35 pm

    @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.

  9. mooskaon 08 May 2007 at 2:36 pm

    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.

  10. links for 2007-05-08 « thebadtimingon 08 May 2007 at 4:01 pm

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

  11. mohammadalion 09 May 2007 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. Ashwineeon 09 May 2007 at 10:10 pm

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

  14. Dev::Infoon 10 May 2007 at 12:47 pm

    PÅ™ipojení k MySQL z FLASH…

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

  15. Julian Sanderon 11 May 2007 at 1:21 am

    “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

  16. mySQL and AS3 link » Darren Richardsonon 17 May 2007 at 5:02 am

    [...] 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. Matton 19 Jul 2007 at 4:29 am

    I have put up a new release on google code.

    http://assql.googlecode.com

Trackback URI | Comments RSS

Leave a Reply