Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Combo box

Explorer ,
Feb 17, 2014 Feb 17, 2014

Hi,

I am using flash cs 5.5. In my demo i crate a xml list .. it contain set of questions.I loaded all of them into combo box. When i finishe answer the question i want to remove the components for the gc. I am albe to remove the Combobox on normal state. But when there is the dropdown menu when i try to remove the component...the list remines there visible.I am not able to remove that.

code are:

//while(comboBox.numChildren>0)

     //comboBox.removeChildAt(0)      // no use

trace(comboBox,"----")      // output [object ComboBox]

comboBox.close();            // output error

trace(comboBox,"***")      // this line not at all printing.

comboBox.removeEventListener(MouseEvent.CLICK,restartTimer);

comboBox    = null;

Error msg:

TypeError: Error #1009: Cannot access a property or method of a null object reference.

    at fl.controls::ComboBox/close()

    at com.sample.elements.components::ComboBoxElement/dispose()

how to solve the issue?

Thanks,

Siva

TOPICS
ActionScript
771
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Feb 17, 2014 Feb 17, 2014

Hi Kglad,

I tryed it.It also didnt solve the issue.But thanks for the input.I got the issue now....

What happend on my case is i added the combobox on a parent movieclip.

First I attempt to remove the parent moveclip from stage then i try to close the combo box. Thats the issue.

But now i changed the coding like first to close the combo box and removing the parent then. Its works now.

Thanks for the replay.

Translate
Community Expert ,
Feb 17, 2014 Feb 17, 2014

use

if(comboBox&comboBox.stage){

comboBox.parent.removeChild(comboBox);

comboBox.removeEventListener(MouseEvent.CLICK,restartTimer);

comboBox    = null;

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 17, 2014 Feb 17, 2014
LATEST

Hi Kglad,

I tryed it.It also didnt solve the issue.But thanks for the input.I got the issue now....

What happend on my case is i added the combobox on a parent movieclip.

First I attempt to remove the parent moveclip from stage then i try to close the combo box. Thats the issue.

But now i changed the coding like first to close the combo box and removing the parent then. Its works now.

Thanks for the replay.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines