Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<Risk>
<Lables>
<Risks name="BMI" change="10" modname=""></Risks>
</Lables>
<Lables>
<Risks name="Physical Activity" change="15" modname="Increase you daily activities"></Risks>
</Lables>
<Lables>
<Risks name="Whole Grain Intake" change="10" modname="Increase whole grain intake"></Risks>
</Lables>
<Lables>
<Risks name="Lacking Healthy Fats" change="5" modname="Eat more health fats"></Risks>
</Lables>
</Risk>
_global.a1=1;
// above prevents the script from firing again since
//the movie has two frames without a stop on either
function processXMLRiskData(success)
{
if (success && a1<2){
a1=1+1;
// Create a variable to store a reference to each checkbox as it is created.
var cchItem:mx.controls.CheckBox;
// how many checkboxes
numBoxes = this.firstChild.childNodes.length;
for (i=0; i<numBoxes; i++) {
// creating an array of items to populate checkboxes
var aLabels:Array = this.firstChild.childNodes[i].childNodes[0].attributes.modname;
// Create a checkbox.
cchItem = this.createObject("CheckBox", "cch" + aLabels[i], this.getNextHighestDepth());
//trace(cchItem); //--> get undefined 4 times
// Assign the checkbox a label.
cchItem.label = aLabels[i];
// Move the checkbox so they are not each overlapping.
cchItem.move(100, 20 * i + 100);
};
// Loop through each of the checkbox to add an event listener.
for(var i:Number = 0; i < aCheckBoxes.length; i++) {
// Add an event listener.
aCheckBoxes[i].addEventListener("click", oListener);
};
}
}