Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

as3 SharedObject || how can i save my score?

New Here ,
Jan 28, 2016 Jan 28, 2016

so.. this is my code

as.png

"so.flush();" -- It keeps my points right?

Unfortunately it does not work for me..

Can someone please fix my code?

TOPICS
ActionScript
727
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Jan 28, 2016 Jan 28, 2016

You're setting score but not doing the flush(). You are only doing flush() in the else. This should work better:

if(so.data.score == null){

     so.data.score = level_mc.bheus_tzt_all.text; //already a string...

     so.flush();

}else{

     level_mc.bheus_tzt_all.text = so.data.score;

}

Translate
New Here ,
Jan 28, 2016 Jan 28, 2016

Anyone who can help me a email disappointing  navtchyev@gmail.com

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jan 28, 2016 Jan 28, 2016

You're setting score but not doing the flush(). You are only doing flush() in the else. This should work better:

if(so.data.score == null){

     so.data.score = level_mc.bheus_tzt_all.text; //already a string...

     so.flush();

}else{

     level_mc.bheus_tzt_all.text = so.data.score;

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 29, 2016 Jan 29, 2016
so.data.score_all = level_mc.bheus_tzt_all.text;
trace(so.data.score_all);

I did this and I worked in the (trace)

But I have to keep the score ...

how?

By the way your code does not really work for me.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 29, 2016 Jan 29, 2016

i can to talk with you in private?

facebook?

of skyp  or something?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jan 29, 2016 Jan 29, 2016
LATEST

Testing for null is only done the one time to initialize the shared object. To store the score you need to both set the property and then flush it:

so.data.score_all = yourScore...

so.flush();

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines