#
# Sample CheckBox example for Swftools http://www.quiss.org/swftools/
#
#
#
#
# CheckBox component included so you can reuse it easy in others projects.
#
#
.flash bbox=300x150 version=6 name="checkbox_proto.swf" compress
.box fond width=300 height=150 color=gray fill=aquamarine line=2
#
# CheckBox component included
#
#
.include checkbox_comp.sci
#
# Place Objects
#
#
.put fond
.action:
// Init parameters for CheckBox Component
//
// 1 - Create an empty movieclip whith 'name'
// 2 - Define position (x,y) for CheckBox_name.
// 3 - Create the new CheckBox :
// CheckBox1 = new CheckBox(CheckBox1, "CheckBox 1", "right", "false", 150);
// (name) = new CheckBox(name, label_text, label_placement, status, label_width)
//
// 4 - Set the function target when event occurs :
// CheckBox11.setEventFunction("Function", object);
// 'object' is _root by default, you can put _parent or other object
//
// 5 - Initialise the component : CheckBox.Initialise();
//
// 6 - Other changes :
// CheckBox1.setSize(100); : Change label width.
// CheckBox1.setStatus("true"); : Change checkbox status.
createEmptyMovieClip("CheckBox1", 1);
CheckBox1._x = 10;
CheckBox1._y = 10;
CheckBox1 = new CheckBox(CheckBox1, "CheckBox 1", "right", "false", 150);
CheckBox1.Initialise();
CheckBox1.setStatus("true");
createEmptyMovieClip("CheckBox2", 2);
CheckBox2._x = 250;
CheckBox2._y = 10;
CheckBox2 = new CheckBox(CheckBox2, "CheckBox 2", "left", "true", 200);
CheckBox2.setEventFunction("Display", _parent);
CheckBox2.Initialise();
CheckBox2.setSize(100);
function Display(value) {
this.Value = value;
if (this.Value == "true") {
this.geturl('javascript:alert(\'You checked this item \')');
} else {
this.geturl('javascript:alert(\'You have unchecked this item \')');
}
}
createEmptyMovieClip("CheckBox3", 3);
CheckBox3._x = 10;
CheckBox3._y = 50;
CheckBox3 = new CheckBox(CheckBox3, "CheckBox 3", "right", "false", 200);
CheckBox3.setEventFunction("setStatus", CheckBox1);
CheckBox3.Initialise();
createEmptyMovieClip("CheckBox4", 4);
CheckBox4._x = 250;
CheckBox4._y = 50;
CheckBox4 = new CheckBox(CheckBox4, "CheckBox 4", "left", "false", 200);
CheckBox4.setEventFunction("Change", CheckBox3);
CheckBox4.Initialise();
.end
.end # End swf movie