|
-
CS3: Trouble with an if/else if conditional...
This script comes from an external .as file that is being referenced by a template flash file. I have an array set up for a dropdown list of pages and I have a movieclip and dynamic text field that I want to change dependent upon the page range being dynamically loaded into a movieclip. The script I am having difficulty with is highlighted in the actionscript below:
// Enter the Course Title and Course # text here:
var title1 = "The Name of the Course";
var title2 = "Secondary Title";
var courseid = "555_302";
//Use this to define page sections:
//section 1:
if (dropdown_cb.value >= 1 && dropdown_cb.value <= 2) {
var section_txt = "Prepare";
var colorful = new Color("_root.section_clr.section2");
colorful.setRGB(0xFF9900);
}
//section 2:
else if (dropdown_cb.value >= 3 && dropdown_cb.value <= 5) {
var section_txt = "Arghhh";
var colorful = new Color("_root.section_clr.section2");
colorful.setRGB(0xFF99CC);
}
//Enter the Page Titles here. Add or delete rows as needed
dropdown_cb.dataProvider = [
{value:0, label:"[01] Yarrr"}
,{value:1, label:"[02] Blech"}
,{value:2, label:"[03] Woot"}
,{value:3, label:"[04] Shoo"}
,{value:4, label:"[05] Meh"}
];
dropshadow(controlbar, .5, .5, .5)
//dropshadow2(dropdown_cb.dropdown, 1, 1, 2)
dropdown_cb.rowCount = 5;
var cbListener:Object = new Object();
cbListener.change = function(evt_obj:Object) {
var item_obj:Object = dropdown_cb.selectedItem;
var i:Number;
for (i in item_obj) {
var swf = _root.playlist[dropdown_cb.selectedItem.value];
trace("SWF :"+swf);
_root.mcLoader.loadClip(swf,_root.mc);
// trace(i + ":\t" + item_obj[i]);
trace("MC OBJ"+item_obj[i]);
var er:Number = dropdown_cb.selectedItem.value;
controlbar.jumper.stepper.value = er;
trace("NUMERIC STEPPER "+ er);
}
};
dropdown_cb.addEventListener("change", cbListener);
The first if part works but will not change when i advance the pages. Can anyone help me with this?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|