1

I'm using the SharedObject code in ActionScript 3. It works perfectly fine when I publish it on my computer but when I publish it on Air for Android, the high score does not work anymore.

enter image description here enter image description here

enter image description here

  • finally found the solution, when using the the sharedobject, you just have to change this code var playerHighScore:SharedObject = SharedObject.getLocal("myscore"); to this one: "myscore" should be changed to the exact apk filename :)) so in my case my apk filename is pandaclash.apk, the sharedobject code should be: var playerHighScore:SharedObject = SharedObject.getLocal("pandaclash"); – Rexcel Cariaga Nov 15 '16 at 04:45

2 Answers2

0

Edit:

i know that android.permission.WRITE_EXTERNAL_STORAGE also contain' READ permission, but as i remember I had the same problem in past which was fixed with it.


i guess android.permission.READ_PHONE_STATE is missing in your appname-app.xml you should make permission's for SharedObject like it:

<android>
    <manifestAdditions><![CDATA[
        <manifest android:installLocation="auto">
            <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
            <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
        </manifest>
    ]]></manifestAdditions>
</android>
payam_sbr
  • 1,428
  • 1
  • 15
  • 24
  • thanks for this but apparently the solution was the sharedobject in var playerHighScore:SharedObject = SharedObject.getLocal("myscore"); "myscore" should be changed to the exact apk filename :)) – Rexcel Cariaga Nov 15 '16 at 04:43
0

finally found the solution, when using the the sharedobject, you just have to change this code

var playerHighScore:SharedObject = SharedObject.getLocal("myscore");

to this one:

"myscore" should be changed to the exact apk filename :))

so in my case my apk filename is pandaclash.apk, the sharedobject code should be:

var playerHighScore:SharedObject = SharedObject.getLocal("pandaclash");