A Flash Developer Resource Site

+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    Mar 2013
    Posts
    5

    [TRANSLATION]Need help with a translation from what i believe is an older AS version

    Hi!, im having a problem, i went online to find out a way to store a highscore locally. I found a flash file wich allowed me to understand some of it, but it doesn't explain to me what i needed (pardon my terrible english)

    Code:
    soScores = SharedObject.getLocal("flashcookie");
    mListener = new Object();
    var score = 0;
    if (soScores.data.highScore != null)
    {
    	highScore = soScores.data.highScore;
    }
    Mouse.addListener(mListener);
    mListener.onMouseDown = function()
    {
    	score++;
    	if (score > highScore)
    	{
    		highScore = score;
    		soScores.data.highScore = highScore;
    	}
    };
    Can someone tell me how i could make this in AS3. if its not to advanced.

  2. #2

  3. #3

  4. #4
    Junior Member
    Join Date
    Mar 2013
    Posts
    5

    More questions

    I thought i had posted an answer but apparantly not.

    I can't make this code connected to the code i already have and i can't seem to understand how that locally added data is written into the text box in the flash file.

  5. #5
    Junior Member
    Join Date
    Mar 2013
    Posts
    5
    "soScores" is undefined, only problem i can get to. i know im an amateur but if you could please help me more. i just need to do this one thing

  6. #6
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    552
    if soScores is undefined, you forgot
    Code:
    soScores = SharedObject.getLocal("flashcookie");

  7. #7
    Junior Member
    Join Date
    Mar 2013
    Posts
    5
    I have already done that. still says its undefined.

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