Hey all,
I have an external variable that changes. When it changes, I want to populate a listbox with a certain image.
Basically, when
variable = 1, populate listbox with image1
variable = 2, populate listbox with image2
and so on.
I can do this with a button event, but I need it to happen when the variable changes and the user does not have to click on anything.
I’ve created a listener object that I cannot get to work. I am suspicious that the listener object does not work with my variable.
ActionScript Code:
[FONT=Courier New][LEFT][COLOR=#000000]var[/COLOR] _iter = empty_mc.[COLOR=#000080]iterator[/COLOR];[COLOR=#808080]//empty_mc.iterator;[/COLOR]
[COLOR=#000000]var[/COLOR] _iterListener:[COLOR=#0000FF]Object[/COLOR] = [COLOR=#000000]new[/COLOR] [COLOR=#0000FF]Object[/COLOR]COLOR=#000000[/COLOR];
_iterListener.[COLOR=#000080]onChange[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR]
[COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]trace[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#000000]}[/COLOR]
_iter.[COLOR=#0000FF]addListener[/COLOR]COLOR=#000000[/COLOR];
[/LEFT]
[/FONT]
Any advice?
Thanks in advance.