Jigsaw Puzzle AS2 Class

Jigsaw Puzzle AS2 HelpJigsaw Puzzle AS2 Help

Help documentation and instructions about installing and using the Jigsaw Puzzle AS2 Component for Flash MX developed by someFrogs. 

Flash Jigsaw Puzzle AS2 Class

Inheritance UIObject > UIComponent > JigsawPuzzle

ActionScript Class Name someFrogs.Puzzles.JigsawPuzzle

The properties of the JigsawPuzzle class allow you to set the content picture, render it as a jigsaw puzzle, and adjust the piece resolution at runtime.

Setting a property of the JigsawPuzzle class with ActionScript overrides the parameter of the same name set in the Property Inspector or Component Inspector panel.

Method summary for the JigsawPuzzle ActionScript 2.0 Class

Method

Description

JigsawPuzzle.startPuzzle()

Starts or restarts the puzle with the given or preset paremeters if not passed any.

Usage myPuzzle.startPuzzle([Linkage [,hRez [,vRez [,eRot, [shStyle]]]]]);
Parameters

Linkage: A string that indicates a reference to the external image (jpeg, swf) file or the library Linkage ID of the symbol to be rendered as puzzle. Sets the picLinkage property.

hRez, vRez: Numbers between 2 and 12 indicating the piece resolution of the puzzle setting the puzzleRezH and puzzleRezV properties. The result of multiplication of those two numbers gives the number of pieces the picture will be dievided. JigsawPuzzle component automatically applies the bigger number to the bigger dimension property (with or height) of the rendered picture.

eRot: A boolen indicating if rotation is enabled. If true JigsawPuzzle uses random rotations for the pieces while setting the puzzle and enables the use of space bar to rotate them. True by default.

shStyle: A string indicating the style of the shapes setting shapeStayle property. The possible values are: "classic", "oval", "square", "triangle" and "mixed". "classic" by default. (Added in v2.1).

The parameters are not required. Last set or preset parameters are used instead of ones passed as NULL.
See the JigsawPuzzle.autostart property if you want to bypass this method.

Examples

myPuzzle.startPuzzle();
Starts or restarts the puzzle with the last parameters passed or parameters given via Property Inspector Panel.

myPuzzle.startPuzzle("mySymbol", 3, 4, true, "oval");
Starts a puzzle with mySymbol as picture, 3x4=12 pieces, rotation enabled and "oval" shape style.

Inherits all methods from UIObject and UIComponent.

Property summary for the JigsawPuzzle ActionScript 2.0 Class

Method

Description

JigsawPuzzle.picLinkage

A reference to the external image (jpeg, swf) file or the symbols library linkage ID to be rendered. Takes affect after JigsawPuzzle.startPuzzle().

JigsawPuzzle.puzzleRezH

The horizontal resolution number. Actually it may apply to vertical resolution according to dimensions of rendered symbol. Takes affect after JigsawPuzzle.startPuzzle().

JigsawPuzzle.puzzleRezV

The vertical resolution number. Actually it may apply to horizontal resolution according to dimensions of rendered symbol. Takes affect after JigsawPuzzle.startPuzzle().

JigsawPuzzle.autoStart

Indicates whether startPuzzle is expected to trigger the rendering process. Use true to start the puzzle with settings passed via Property Iinspector or Component Inspector panel and false if you wish to start puzzle after passing parameters at runtime. The default value is true. Takes affect after JigsawPuzzle.startPuzzle().

JigsawPuzzle.enableRotation

Indicates whether rotaion of pieces using space bar is enabled. Use true for puzzle with rotation and false for non rotational. The default value is true.

JigsawPuzzle.shapeStyle

Indicates the style of the shapes. The possible values are: "classic", "oval", "sqare", "triangle" and "mixed". "classic" by default. (Added in v2.1).

JigsawPuzzle.matchBlinkCount

Indicates a number for blink counts on matched pieces. Enter 0 if you don't want the pieces blink on match. 5 by default. (Added in v2.2).

Inherits all properties from UIObject and UIComponent.

Event summary for the JigsawPuzzle ActionScript 2.0 Class

Method

Description

JigsawPuzzle.match

Event; broadcast to all registered listeners when pieces of the JigsawPuzzle matched. You can trigger a sound to add some attraction to the game.(Added in v2.2).

JigsawPuzzle.done

Event; broadcast to all registered listeners when the JigsawPuzzle is done.

Usage
listenerObject = new Object();
listenerObject.match = function(eventObject){
// insert your code here
}

listenerObject.done = function(eventObject){
// insert your code here
}
myPuzzleInstance.addEventListener("match", listenerObject);
myPuzzleInstance.addEventListener("done", listenerObject);

Inherits all events from UIObject and UIComponent.

Using Jigsaw Puzzle AS2

Jigsaw Puzzle AS2
Jigsaw Puzzle AS2

Jigsaw Puzzle ActionScript 2.0 is a Flash MX 2004 UI Component developed by someFrogs. Unlike most other jigsaw puzzle generators for Flash, Jigsaw Puzzle AS2 recognizes the neighbour pieces put near in right direction and then groups them. This makes the puzzle game more real and more fascinating. With this easy to use and customizable flash puzzle script you can build your own jigsaw puzzles that can be published as online flash games or compiled as desktop flash game applications.