Posts Tagged ‘air’

MongoDB ObjectID for AS3

Posted in to do on April 2nd, 2012 by ericsoco – 4 Comments

I’ve been working with MongoDB as of late, and finding the offerings for an ActionScript 3.0 driver to be rather lacking.

I started with ActionMongo, and quickly found out that it has no support for much of anything except the find() command.  I then found my way to MongoAS3, which is a HUGE improvement over the barely-started functionality within ActionMongo.  (Credit where credit’s due, Omar Gonzales built MongoAS3 off of Claudio Alberto Andreoni’s first steps with ActionMongo.)

However, I found a missing piece in MongoAS3 that was holding me back: it doesn’t provide any way to generate a new ObjectID.  This is a problem if, for example, you want to insert a new document.  Since Mongo doesn’t provide a response on a successful insert, this means that a followup query is required to get the ObjectID assigned by the server to the newly-inserted document.  Not ideal.

So, I added functionality to ObjectId.as (which Omar included from Claudio’s original, as part of ActionBSON) to generate a new ObjectID per the ObjectID spec.  The one deviation from the spec comes from the difficulty in getting the process ID from within a flash runtime (requires launching a NativeProcess, which can only be done from an AIR application with the extendedDesktop profile); for this, we’re just using a random.

I also added the ability to extract the timestamp from the ObjectID, which could prove useful.

Hope it’s useful to some of you…I’ve submitted it to Claudio and Omar for inclusion into their distros.  Code after the break, or on Github. (I need a better Gist plugin…)

read more »

true fullscreen in AIR on OSX

Posted in to do on January 12th, 2010 by ericsoco – 3 Comments

been trying to figure this one out for about a year and a half now, and finally stumbled across the answer.

those of you who’ve tried to fullscreen an AIR app in OSX know about the annoying grey bar across the bottom of the screen. apparently, that’s a status bar. i guess you can even set status messages into it. handy, perhaps, if you’re making a browser entirely in AIR. but i think most of us just want it to go away.

you can do this by adding showStatusBar="false" to your mx:WindowedApplication tag.
(you can also add status with status="who needs this stupid grey bar?".)

i found this out while playing with mx:Windows. all NativeWindows have a statusBar by default. how bout that.

-eric