A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] AS2 SharedObject.getLocal

  1. #1
    Senior Member
    Join Date
    Apr 2002
    Posts
    113

    resolved [RESOLVED] AS2 SharedObject.getLocal

    I recently purchased CS4 and am trying to publish some older files with no changes to them and am having the following problem.

    I want to place a SharedObject on the local machine. The idea is this. Students take a quiz once. When they try to take the quiz twice and they are sent to a frame telling them they can't.

    I used this code with Flash MX 2004

    PHP Code:
    my_so SharedObject.getLocal("myCookie");
    if (
    my_so.data.lock445556789) {
    gotoAndPlay("locked");
    }
    my_so.data.lock445556789 true;
    my_so.flush(); 
    When I publish those files as projector files (player 6, actionscript 1) in CS4 they work fine.

    I used the same code in Flash 8 (player 8, actionscript 2). The code worked fine when published with flash 8 but no longer works when the same files are published in CS4. (Everything else works fine)

    I tried updating just that snippet of code to this.

    PHP Code:
    var mySharedObject:SharedObject SharedObject.getLocal("myCookie");
    if (
    mySharedObject.data.skipQuiz == "12345") {
        
    gotoAndPlay("locked");
    } else {
        
    play();
    }
    mySharedObject.data.skipQuiz "12345";
    mySharedObject.flush(); 
    The files work when published as SWF but not when they are published as projector files. I would appreciate any suggestions.

  2. #2
    Senior Member
    Join Date
    Apr 2002
    Posts
    113
    I should mention. The above code appears on the first frame of the main timeline.

  3. #3
    Senior Member
    Join Date
    Apr 2002
    Posts
    113
    I found the documentation that solved my problem. I needed to disable the new security settings in CS4 before using getLocal().

    PHP Code:
      Security.exactSettings=false
    Now everything works fine.

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