.flash bbox=300x150 version=6 name="checkbox2.swf" compress background=#778899 .box fond width=300 height=150 color=gray fill=aquamarine line=2 .include checkbox_comp.sci .put fond .edittext log width=300 height=40 .put log .action: // - Create an empty movieclip with 'name' // - Define position(x,y) for CheckBox sprite. // - Create new CheckBox : // ex:cb1=new CheckBox(cb1,"CheckBox 1","right",false,150); // name=new CheckBox(name,label_text,label_placement,status,label_width) // // cb1.setEventFunction("Function",object); object (_root by default), can be put to another object // - Other functions : // cb1.setSize(100); // Change label width. // cb1.setStatus("true"); // Change status createEmptyMovieClip("cb1", 1); cb1._x = 10; cb1._y = 10; cb1=new CheckBox(cb1,"Chocolate","right",true); cb1.setSize(100);// 60 by default createEmptyMovieClip("cb2", 2); cb2._x = 250; cb2._y = 10; cb2 = new CheckBox(cb2,"Sugar","left",true); cb2.setEventFunction("Display",_parent); function Display(obj) { var txt; if (obj.value==true) txt=obj.Label+' has been checked '; else txt=obj.Label+' has been unchecked '; this.geturl("javascript:alert(\'"+txt+"\')"); } createEmptyMovieClip("cb3",3); cb3._x = 10; cb3._y = 50; cb3 =new CheckBox(cb3,"Coffee","right",false); cb3.setEventFunction("setStatus",cb2); createEmptyMovieClip("cb4",4); cb4._x = 250; cb4._y = 50; cb4 =new CheckBox(cb4,"Tea","left",false); cb4.setEventFunction("Change",cb2); .end .end # .flash