PDA

View Full Version : another scrollbar thread


cheez
12-30-2002, 03:53 PM
Hehe, it's huntin' season on scrollbars today...

I have a dynamic text box that has a scrollbar embedded it by using standard MX components. Although the scrollbar does "snap" into place and resizes, it simply does not work. The text box is good, though, meaning that the hidden text is selectable which makes me not completely dead in the water.

Here is the little code that I did put into main timeline:


_root.scrollbarA.setSmallScroll(3);
_root.scrollbarA.setScrollTarget(_root.colorlist);


...where "scrollbarA" is the name of the scrollbar instance and "colorlist" is the name of the texfield object. I actually already have the scrollbar targeting this object during authoring but wanted to see if "overiding" it helped.

What am I missing ;) ?

Thanks,
Cheez

bembino
12-31-2002, 03:56 AM
I dunno. I did it and it worked fine. Can you send an FLA? flashHelp@xonesix.com

cheez
12-31-2002, 06:28 AM
Howdy, try:

http://www.netwiz.net/~cheez/hexanalyzer.html
http://www.netwiz.net/~cheez/hexanalyzer.ZIP

Thanks,
Cheez

Originally posted by bembino
I dunno. I did it and it worked fine. Can you send an FLA? flashHelp@xonesix.com

bembino
12-31-2002, 08:02 AM
Ok...should work now. There were two "issues"...

1. Your textfield had the same instance name as the variable that was associated with it. This may have been causing some conflicts. I renamed the textfield colorlist_txt.

2. The other was that for some reason updating the variable that is associated with a textfield was not updating the scrollbar. instead you needed to update the text property of that textfield in order to update the scrollbar.

You can view the fixed file here (http://www.xonesix.com/forums/hexanalyzer_fix.html) and download it here (http://www.xonesix.com/forums/hexanalyzer_fix.zip).

cheez
12-31-2002, 09:11 PM
Yessir, got it. Looks good. Scroll bar works. Did see the extra "update" code for the textField. I believe naming the instance and it's variable the same thing is error prone. Must stop now! ;)

And of course, I really appreciate you helping debug this issue for me. Invaluable. :)

Thanks,
Cheez


Originally posted by bembino
Ok...should work now. There were two "issues"...

1. Your textfield had the same instance name as the variable that was associated with it. This may have been causing some conflicts. I renamed the textfield colorlist_txt.

2. The other was that for some reason updating the variable that is associated with a textfield was not updating the scrollbar. instead you needed to update the text property of that textfield in order to update the scrollbar.

You can view the fixed file here (http://www.xonesix.com/forums/hexanalyzer_fix.html) and download it here (http://www.xonesix.com/forums/hexanalyzer_fix.zip).