Skip to main content
May 14, 2011
Question

flash cs5.5 - sharedObject

  • May 14, 2011
  • 3 replies
  • 1153 views

I migrated my iPhone app from flash cs5 to cs5.5. The performance is much better but suddenly I can't write/read sharedObjects. Any idea what might be happening? I didn't have this problem with flash cs5.

Jakub

This topic has been closed for replies.

3 replies

Participant
September 3, 2011

Hi, Nice to meet you, would you mind to answer me, how

performance made by 5.5 vs 5 on iPhone? especailly on graphic display,

bocz I want to upgrade but 5.5. trial version can deploy to iphone... please help!!

Known Participant
May 16, 2011

CS5 to CS5.5 you probably change Air 2.5 to Air 2.6, so it's probably not exactly the same code.

Well, SharedObject should be ok... ... so it's maybe the write permissions ?

Here a exemple by me:

package {
        import flash.desktop.NativeApplication;
        import flash.display.Sprite;
        import flash.display.StageAlign;
        import flash.display.StageScaleMode;
        import flash.events.Event;
        import flash.events.TouchEvent;
        import flash.geom.Matrix;
        import flash.net.SharedObject;
        import flash.sensors.Accelerometer;
        import flash.text.TextField;
        import flash.text.TextFieldType;
        import flash.ui.Multitouch;
        import flash.ui.MultitouchInputMode;

    public class Main extends Sprite {
           
            private static var _tf:TextField;
       
            public final function Main(){
                    stage.scaleMode = StageScaleMode.NO_SCALE;
                    stage.align = StageAlign.TOP_LEFT;
                   
                    _tf = new TextField();
                    _tf.text = "Hello World";
                    _tf.width = 480;
                    _tf.height = 800;
                    _tf.multiline = true;
                    _tf.selectable = true;
                    _tf.type = TextFieldType.INPUT;
                   
                    addChild(_tf);
                   
                    load();
                   
                    NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE, save);
                   
                    Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
            }
           
            public final function load():void {
                // Get the shared object.
                var so:SharedObject = SharedObject.getLocal("HelloWorld");
               
                if(so.data["tf"] != null){
                    _tf.text = so.data["tf"];
                }
            }
           
            public final function save(e:Event):void {
                // Get the shared object.
                var so:SharedObject = SharedObject.getLocal("HelloWorld");
               
                so.data["tf"] = _tf.text;
               
                so.flush();
            }
               
    }
}

relaxatraja
Inspiring
May 16, 2011

Whether shared objects are working in Iphone?