A Flash Developer Resource Site

Results 1 to 7 of 7

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

Hybrid View

  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
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    927
    I think if you understand AS3 this older code is still perfectly readable. Maybe the problem is you don't understand either Let me suggest

    http://help.adobe.com/en_US/FlashPla...ctionscript/2/
    http://help.adobe.com/en_US/FlashPla...ctionscript/3/

    In particular

    http://help.adobe.com/en_US/FlashPla...ouseEvent.html
    http://help.adobe.com/en_US/FlashPla...redObject.html
    who is this? a word of friendly advice: FFS stop using AS2

  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
    927
    if soScores is undefined, you forgot
    Code:
    soScores = SharedObject.getLocal("flashcookie");
    who is this? a word of friendly advice: FFS stop using AS2

  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