SiteExperts.com Logo Home | Community | Developer's Paradise | Jobs
User Groups | Site Tools | Site Information | Search

Inside Technique : Sliding Puzzle Scriptlet
By Scott Isaacs

Convert any image into a sliding puzzle!



Scale:
Rows:
Cols:

Loading...

Reference

    <OBJECT
      TYPE="text/x-scriptlet" 
      DATA="puzzle.htm" 
    </OBJECT>
PropertiesimgThe URL of the image.
scaleThe default size of the image is used. This specifies whether to scale the image larger or smaller. The puzzle automatically sizes itself to the size of the contents.
rowsThe number of rows to break the puzzle into.
colsThe number of cols to break the puzzle into.
moves(R/O) Returns the number of moves played in the current game.
Methodsplay()Starts a new game.
solve()Solves the game.
EventsonreadyThe game is ready to be played. This event occurs every time the game is customized.
onnotreadyThis event occurs if the play() method is called before the image is downloaded.
onmoveThe user performed a valid move.
onerrorThe image failed to download.
onwinThe user solved the game
onplayOccurs after the play() method is called and the game is ready to be played.
onsolveOccurs after the solve() method is called and the game is reset.