This is driving me crazy. It seems I cannot use ScrollPane ANYWHERE in my AS3 code without it crashing every dropdown box in the program.
Here is the error message I get when clicking a dropdown box:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at fl.containers::BaseScrollPane/drawBackground()
at fl.controls::List/draw()
at fl.core::UIComponent/drawNow()
at fl.controls::List/scrollToIndex()
at fl.controls::SelectableList/scrollToSelected()
at fl.controls::ComboBox/open()
at fl.controls::ComboBox/onToggleListVisibility()
This happens when clicking ANY dropdown box, regardless of whether or not the code referencing ScrollPane has been executed. The really retarded thing is that I can't even declare a scrollPane var without it causing these errors. IE this:
var x:ScrollPane;
causes all dropdowns to break. And no, I'm not trying to reference x without initializing it. Initializing Scrollpanes using 'new' causes the same problem, as well as casting anything to a ScrollPane.
To get around this, I have been creating scrollpanes directly in the fla and referencing them from AS. This doesn't break the program, and I can access their properties. They even work fine this way.
In short, using the word 'ScrollPane' anywhere in the program breaks it. This is not just my system either. It is happening to at least two other devs I work with.
Any ideas?
edit:
So after scouring the interweb for a while, most people are solving this issue by following bhups suggestions below and adding the component to the library. I'm adding the thing to my main fla from window -> components -> ScrollPane and it indeed shows up in the library. It still doesn't work. I even put one instance on the stage to make sure it had all of the symbols it needed to no avail. Does anyone know of any settings that may be incorrect or anything else I can look at? I will provide any info if necessary.