AlladinYYC
10-10-2005, 06:50 PM
know i have raised this issue before but i'm still fighting with it and i would appreciate any insight. I thought that something within my application was creating a problem with in these two so i created a brand new application that just has the two components. The accordion and the combo box. Both generated dynamically. The accordion has 3 tabs... in the first tab i add a combo box. It adds fine but it doesn't respond to clicking on it... anotherwords it doesn't want to open.
Please try it out: copy the following code into a new file and add the accordion and the combobox to your library.
Another thing to mention too is that when i added an "open" listener - it does catch... it says that it's opened when the arrow is pressed... but you can see it
import mx.containers.Accordion;
import mx.controls.ComboBox;
import mx.core.View;
//
this.onLoad = function() {
//
createClassObject(Accordion, "menuAccordion", _root.getNextHighestDepth());
_root.menuAccordion.setStyle("themeColor", "haloOrange");
_root.menuAccordion.move(0, 0);
_root.menuAccordion.setSize(550, 400);
_root.menuAccordion.setStyle("backgroundColor", "0xFDFDFD");
//create tabs
_root.menuAccordion.createChild(View, "fileAccordion", {label:" File..."});
_root.menuAccordion.createChild(View, "lessonAccordion", {label:" Lesson Options"});
_root.menuAccordion.createChild(View, "paragraphAccordion", {label:" Paragraph Content"});
//
_root.menuAccordion.fileAccordion.createEmptyMovie Clip("paragraphContainer", 0);
//question type selection
_root.menuAccordion.fileAccordion.paragraphContain er.createTextField("questionTypeText", _root.menuAccordion.paragraphAccordion.paragraphCo ntainer.getNextHighestDepth(), 50, 20, 320, 20);
_root.menuAccordion.fileAccordion.paragraphContain er.questionTypeText.type = "static";
_root.menuAccordion.fileAccordion.paragraphContain er.questionTypeText.selectable = false;
_root.menuAccordion.fileAccordion.paragraphContain er.questionTypeText.htmlText = "Question Type:";
//
_root.menuAccordion.fileAccordion.paragraphContain er.createClassObject(ComboBox, "questionTypeInputText", _root.menuAccordion.paragraphAccordion.paragraphCo ntainer.getNextHighestDepth());
_root.menuAccordion.fileAccordion.paragraphContain er.questionTypeInputText.move(170, 20);
_root.menuAccordion.fileAccordion.paragraphContain er.questionTypeInputText.setSize(150, 22);
_root.menuAccordion.fileAccordion.paragraphContain er.questionTypeInputText.dataProvider = [{label:"Multiple Choice", data:"multiplechoice"}, {label:"True or False", data:"trueorfalse"}, {label:"Fill in the Blank", data:"fillintheblank"}];
_root.menuAccordion.fileAccordion.paragraphContain er.questionTypeInputText.enabled = true;
//
var cbListener:Object = new Object();
cbListener.change = function(evt_obj:Object):Void {
var currentlySelected:Object = evt_obj.target.selectedItem;
trace(evt_obj.target);
trace("data: "+currentlySelected.data);
trace("label: "+currentlySelected.label);
};
_root.menuAccordion.fileAccordion.paragraphContain er.questionTypeInputText.addEventListener("change", cbListener);
var cbListener2:Object = new Object();
cbListener2.open = function(evt_obj:Object):Void {
trace("I opened");
var currentlySelected:Object = evt_obj.target.selectedItem;
trace(evt_obj.target);
trace("data: "+currentlySelected.data);
trace("label: "+currentlySelected.label);
};
_root.menuAccordion.fileAccordion.paragraphContain er.questionTypeInputText.addEventListener("open", cbListener2);
};
Please try it out: copy the following code into a new file and add the accordion and the combobox to your library.
Another thing to mention too is that when i added an "open" listener - it does catch... it says that it's opened when the arrow is pressed... but you can see it
import mx.containers.Accordion;
import mx.controls.ComboBox;
import mx.core.View;
//
this.onLoad = function() {
//
createClassObject(Accordion, "menuAccordion", _root.getNextHighestDepth());
_root.menuAccordion.setStyle("themeColor", "haloOrange");
_root.menuAccordion.move(0, 0);
_root.menuAccordion.setSize(550, 400);
_root.menuAccordion.setStyle("backgroundColor", "0xFDFDFD");
//create tabs
_root.menuAccordion.createChild(View, "fileAccordion", {label:" File..."});
_root.menuAccordion.createChild(View, "lessonAccordion", {label:" Lesson Options"});
_root.menuAccordion.createChild(View, "paragraphAccordion", {label:" Paragraph Content"});
//
_root.menuAccordion.fileAccordion.createEmptyMovie Clip("paragraphContainer", 0);
//question type selection
_root.menuAccordion.fileAccordion.paragraphContain er.createTextField("questionTypeText", _root.menuAccordion.paragraphAccordion.paragraphCo ntainer.getNextHighestDepth(), 50, 20, 320, 20);
_root.menuAccordion.fileAccordion.paragraphContain er.questionTypeText.type = "static";
_root.menuAccordion.fileAccordion.paragraphContain er.questionTypeText.selectable = false;
_root.menuAccordion.fileAccordion.paragraphContain er.questionTypeText.htmlText = "Question Type:";
//
_root.menuAccordion.fileAccordion.paragraphContain er.createClassObject(ComboBox, "questionTypeInputText", _root.menuAccordion.paragraphAccordion.paragraphCo ntainer.getNextHighestDepth());
_root.menuAccordion.fileAccordion.paragraphContain er.questionTypeInputText.move(170, 20);
_root.menuAccordion.fileAccordion.paragraphContain er.questionTypeInputText.setSize(150, 22);
_root.menuAccordion.fileAccordion.paragraphContain er.questionTypeInputText.dataProvider = [{label:"Multiple Choice", data:"multiplechoice"}, {label:"True or False", data:"trueorfalse"}, {label:"Fill in the Blank", data:"fillintheblank"}];
_root.menuAccordion.fileAccordion.paragraphContain er.questionTypeInputText.enabled = true;
//
var cbListener:Object = new Object();
cbListener.change = function(evt_obj:Object):Void {
var currentlySelected:Object = evt_obj.target.selectedItem;
trace(evt_obj.target);
trace("data: "+currentlySelected.data);
trace("label: "+currentlySelected.label);
};
_root.menuAccordion.fileAccordion.paragraphContain er.questionTypeInputText.addEventListener("change", cbListener);
var cbListener2:Object = new Object();
cbListener2.open = function(evt_obj:Object):Void {
trace("I opened");
var currentlySelected:Object = evt_obj.target.selectedItem;
trace(evt_obj.target);
trace("data: "+currentlySelected.data);
trace("label: "+currentlySelected.label);
};
_root.menuAccordion.fileAccordion.paragraphContain er.questionTypeInputText.addEventListener("open", cbListener2);
};