Hello Glen, works fine for me:
[SWF] C:\FDT\AS\Tests\Main.swf - 2 947 bytes after decompression [object Main] loading persisted value [object Main] loaded value is 123 [object Main] saving value 123 result true 2010/3/1 Glen Pike <g...@engineeredarts.co.uk>: > Hi Guys, > > I am having a problem using SharedObjects on Gentoo - kernel 2.6.29 that > does not seem to appear in 2.6.30, but I want to make sure it is not because > of some setting on my machine. > > We run FlashPlayer from the command line, but still seem to be governed by > the FlashPlayer settings, which have been "applied" using the browser and > the "Settings Panel SWF". > > Problem is the following code in testPersistence() seems to kill the > FlashPlayer with a segfault in one of the libc libraries on my machine. > Because we are using cloned disks, I am a bit wary that the settings for FP > may be screwed, or a permissions error may be occurring. > > I just wanted to know if anyone else has seen this at all - I have googled > and jira'd but no luck at the moment. > > Cheers > > Glen > public class Persistence { > protected static var _instance:Persistence; > public function Persistence() { > if (null != _instance) { > throw Error("Cannot have more than one instance of > Persistence"); > } > _instance = this; > } > public static function getInstance():Persistence { > if (null == _instance) { > _instance = new Persistence( ); > } > return _instance; > } > public static function saveValue(name:String, value:*):Boolean { > var so:SharedObject = SharedObject.getLocal("interface_app"); > if (null == so) { > return false; > } > try { > so.data[name] = value; > }catch (e:Error) { > trace("Persistence::saveValue exception " + e); > } > var res:String = so.flush(); > if (SharedObjectFlushStatus.FLUSHED == res) { > return true; > } else { > return false; > } > } > public static function loadValue(name:String):* { > var so:SharedObject = SharedObject.getLocal("interface_app"); > if (null == so) { > return null; > } > var value:*; > try { > value = so.data[name]; > } catch (e:Error) { > trace("Persistence::loadValue exception " + e); > } > if (undefined == value) { > value = null; > } > return value; > } > } > } > > function testPersistence():void { > try { > trace(this, "loading persisted value"); > var testing:Object = Persistence.loadValue("testing"); > trace(this, "loaded value is " + testing); > trace(this, "saving value 123"); > //The following line triggers a SEGFAULT > var result:Boolean = Persistence.saveValue("testing", "123"); > trace("result " + result); > } catch (e:Error) { > trace("there was an error " + e); > } > } > _______________________________________________ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- iv http://www.bezier.ru http://bezier.googlecode.com _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders