10 Replies Latest reply on Jan 23, 2013 11:27 AM by Bramblethorne

    Fairly certain that FileStream.writeObject() and FileStream.readObject() do not function - at all -.

    Bramblethorne Level 1

      I've struggled with this since Jan 9th, 2013 (if not longer) and the only conclusion I can come to is that this simply does not function.  No matter what I try and no matter what resource (and I'm finding precious few) I follow to try to implement this within Flash Builder 4.7, Flex SDK 4.6.0 (Build 23201), AIR SDK 3.5, I only succeed in creating a file (with the correct name) that is 123 bytes in size that reads back in as NULL;

       

      I've tried using ByteArray.writeObject()/readObject() as an intermediary with FileStream.writeBytes()/readBytes(), with no luck.

       

      I've tried instantiating an object, setting properties and then using that.  I've tried instantiating my correctly formed ValueObject (including the remoteClass alias metadata tag).

       

      I've tried using -verbatim- the example provided in the top most suggested 'Community Help' resource http://www.switchonthecode.com/tutorials/adobe-air-and-flex-saving-serialized-objects-to-f ile It is worth noting that this solitary example of the procedure/SDK-usage is dated to Flex SDK 3.0 and at least 04/04/2009 (first comment on the article).

       

      My frustrating hell (one version of many methods attempted) is detailed on StackOverflow (including -all- mxml, as, and trace output), but so far, no assistance has been forthcoming, alas.  This is a severely stripped down and simplified version of what had been a far more complex attempt:

      http://stackoverflow.com/questions/14366911/flex-air-actionscript-mobile-file-writeobject- readobject-always-generates-null-w

       

      An earlier post* detailing a far more complex attempt interation, with, alas, just as little help (guess this isn't a hot button topic) forthcoming:

      http://stackoverflow.com/questions/14259393/flex-actionscript3-filestream-writeobject-fail s-silently-in-ios-what-am-i-doin

       

      * I previously suspected that it was only failing from within iOS on an iPad, but the first example (the stripped down version) made it evident that it didn't work in the AIR mobile device simulator (iPad) in the Windows environment, and indeed, didn't work in a non-mobile project in the windows environment AIR launcher.

       

      I'm at a loss, upset, frustrated, in major trouble with my supervisor/deadlines, etc.

       

      I would very much appreciate any suggestions/help/confirmation/etc.

       

      Just to move ahead with development I've opted for a far less preferable solution of writing out both an XML file and a JPG file.  I very much do not like this and very much want to store encapsulated serialized objects locally in the same way I assume will work for storing remotely with AMFPHP (if the project ever gets to that point *sigh*).

       

      Again.  Would be so grateful for any help.