Executing JS from Stencyl game and getting SHA1 hash from text

Darkhog

  • Posts: 1243
I think I found way to make custom highscores instead these offered by Stencyl (basically my concern is that guest scores will show up as Guest and you can't make possible for players to input their name in-game like for example in MochiScores), but I need two things.


1) How to execute JS code from stencyl game (basically this is for updating iframe with scores on the game page)
2) How to make SHA1 hash from text (this is used for validation if the score is real one and to avoid cheating)

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D

Matt_S

  • Posts: 46
Here's some stuff about executing JavaScript:
http://blog.codefidelity.com/?p=15
http://scriptplayground.com/tutorials/as/Call-Javascript-in-Flash/
For SHA1, there's a lot of example implementations out there, some of them in AS3.  I don't personally know the algorithm, so I can't vouch for their accuracy.

I don't see how this will get you what you want, though.

Darkhog

  • Posts: 1243
For SHA1 I found this class: http://gsolo.com/temp/macromedia/flex/beta/Global/com/gsolo/encryption/SHA1.zip but I don't know how to use it with Stencyl (in particular how to add it to game).

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D