There's no UserDefault into the binding?

I am getting the message TypeError: cc.UserDefault is undefined when trying to access the cc.UserDefault from a HTML5 code.

Am I doing anything wrong? There is no way to save the progress using the javaBinding?

[]’s

1 Like

Plz use sys.LocalStorage instead.

@James Chen

Hey James, thanks for the answer. Yeah in fact I got this working last Friday using the exactly:

sys.localStorage.setItem(“string”, 0);
>
sys.localStorage.getItem(“string”);

I think there’s the need to use a little bit of parser to not mess with the code, but it works good.

If anyone needs to see an example try to take a look at the WatermelonWithMe example, it has some use of this code there.
Cheers!