ielane
01-14-2003, 02:32 AM
Hi all, I've got a set of dynamic buttons that will display according to how many scenes in the XML file. But I don't know how or what code to write to access the numerical value.
<Lesson>
<LessonNum>Unit 1</LessonNum>
<LessonTitle>Differentiation</LessonTitle>
<ToolTip>Find out details about Differentiation</ToolTip>
<Scenes>5</Scenes>
</Lesson>
Currently, my buttons display with regard to the number of lessons. With the code:
for (i=0; i<lessons.length; i++) {
name = "nn"+i;
base_MC.attachMovie("btn_mc_id", name, i+2);
//set position of 1st btn//
with (base_MC[name]) {
_width = base_MC._width / lessons.Scenes.int // fitting btns inside base_MC by adjusting btn width
_x = _width*i;
_y = 0;
}
}
ielane.
<Lesson>
<LessonNum>Unit 1</LessonNum>
<LessonTitle>Differentiation</LessonTitle>
<ToolTip>Find out details about Differentiation</ToolTip>
<Scenes>5</Scenes>
</Lesson>
Currently, my buttons display with regard to the number of lessons. With the code:
for (i=0; i<lessons.length; i++) {
name = "nn"+i;
base_MC.attachMovie("btn_mc_id", name, i+2);
//set position of 1st btn//
with (base_MC[name]) {
_width = base_MC._width / lessons.Scenes.int // fitting btns inside base_MC by adjusting btn width
_x = _width*i;
_y = 0;
}
}
ielane.