返回顶部

收藏

UI组件-Check box

更多

UI组件-Check box。用法:Place a checkbox component on the stage and give it an instance name of myCheckbox. Drag a textArea component onto the stage and giev it an instance name of myLabel. paste the code onto frame one of the movie.

[Flash/ActionScript/Flex]代码

// create event listener object for checkbox
myCheckboxListener = new Object();
// click event handler
myCheckboxListener.click = function() {
     if (myCheckbox.selected) {
          myLabel.text = "You have checked the checkbox!";
     } else {
          myLabel.text = "You have unchecked the checkbox!";
     }
};
// register the event listener
myCheckbox.addEventListener("click", myCheckboxListener);
// clear the label
myLabel.text = "";

标签:ActionScript,CheckBox,组件

收藏

0人收藏

支持

0

反对

0

发表评论