Search Tutorials
The Actionscript: function onChange(component)As the last step we now define the function onChange with the argument component, which indicates to flash that this is a function for a component.
//the function onChange is defined for components, in this case radio buttons. Our function basically consists of a number of if statements. What we do is we ask if the value, which we previously set for a radio button is identical (==) to that button. If so then make the movieclip box visible and execute the function createNewLocal(weekDay); where we replace weekDay with the actual day. And thatīs it.
function onChange(component){
//we call the value of a button, if the button is selected by the user.
if (_root.radioGroup.getValue()=="Monday"){
//the movieclip will now be visible
_root.box._visible = true;
//we create a shared object called "Monday" using the above function
createNewLocal("Monday");
}else if (_root.radioGroup.getValue()=="Tuesday"){
_root.box._visible = true;
createNewLocal("Tuesday");
}else if (_root.radioGroup.getValue()=="Wednesday"){
_root.box._visible = true;
createNewLocal("Wednesday");
}else if (_root.radioGroup.getValue()=="Thursday"){
_root.box._visible = true;
createNewLocal("Thursday");
}else if (_root.radioGroup.getValue()=="Friday"){
_root.box._visible = true;
createNewLocal("Friday");
}else if (_root.radioGroup.getValue()=="Saturday"){
_root.box._visible = true;
createNewLocal("Saturday");
}else if (_root.radioGroup.getValue()=="Sunday"){
_root.box._visible = true;
createNewLocal("Sunday");
}
}
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||
|