A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [as3][FD] Shared Object being given wrong name/odd text

  1. #1
    Member Manic_Man's Avatar
    Join Date
    Dec 2007
    Location
    Hastings, England
    Posts
    91

    [as3][FD] Shared Object being given wrong name/odd text

    Using Flash Develop, i'm using a bit of sharedobject code I've used in the past and had no problems with.. However, when I pass the name of the variable to be saved, it says that name in a corrupted way. the first character is always missing and has been replaced with a [] character at the end (white square).

    as it's on the saving side, here is the setcookie function I use:

    Code:
    public static function setCookie(c:String, n:*, v:*):void{
    			//Saves a variable to Flash Cookie file
    			//AKA shared Object
    			//c is Cookie Name
    			//n is Variable Name
    			//v is Variable value
    			var mySo:SharedObject; = SharedObject.getLocal("Test1");
    			mySo.data[n] = v;
    			var StatusResults:String = null;
    			StatusResults = mySo.flush();
    			if (StatusResults != null){
    			}
    		}
    should be easy to follow as it's not complex or anything. the n value is the name, so the shared object file should have a variable called whatever is in 'n', with the value of whatever is in 'v'.

    I don't think it's a flash develop bug, nor do I think it's a code bug so.. i'm completetly lost.. tracing commands gives the variable name as being passed correctly and seams to be correct inside the data object

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    The shared object file is stored encoded, so it will look something like so.

    PHP Code:
    ¿   6TCSO      myName   c_x-     bw_xƒY c_y{     bw_y 
    that is a real *.sol file.

    so you have nothing to worry about when you look at the file.

    you should try loading the shared object to see what you have saved.

    http://www.republicofcode.com/tutori...3sharedobject/

  3. #3
    Member Manic_Man's Avatar
    Join Date
    Dec 2007
    Location
    Hastings, England
    Posts
    91
    yeah, I know they are encoded ^_^:
    it seams the problem was with my Sol reader.. or more editor.. for some reason, it read the sol file wrong (normally it's pretty good), but the Reader with Develop reads it fine (just doesn't allow editing)..

    so thanks but it all seams fine now for some reason.. well, not 100% fine but fine enough to work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center