PDA

View Full Version : Radiobutton setLabel inside of scrollpane


xbrotherx
02-12-2004, 12:01 AM
Ok so I got the actual default label of the radiobutton component to show up in the scrollpane by embedding the font.

Now I want to dynamically set the label of the radiobutton using setLabel but it ain't workin'.

I am writing like so:


scrollpane_mc.content_mc.radioButton.setLabel("whatever");


But hey, it doesn't work.

Any suggestions?

xbrotherx
02-12-2004, 08:39 AM
Ok this is becoming a bad habit figuring out my own problems....or maybe a good habit.

Anyway, I had a scrollpane with an instance name of scrollpane_sp. And I loaded in the content from a linked library item which had a linkage name of scroll_content.

And inside that scroll_content mc I had two radio buttons name ans1_rb and ans2_rb.

So my goal was to execute the following:


scrollpane_sp.setScrollContent("scroll_content");
//the dynamically set the labels on the radio buttons
scrollpane_sp.scroll_content.ans1_rb.setlabel("label 1");
scrollpane_sp.scroll_content.ans2_rb.setlabel("label 1");


Didn't work.

So I traced the name of the scroll_content just to see what it's targeting name was by using:

scrollpane_sp.getScrollContent

and sure enough it had a default name of tmp_mc.

So now I can set my labels by simply using


scrollpane_sp.tmp_mc.ans1_rb.setLabel("label 1");


It's not the most elegant way and surely there is a way to change the name of tmp_mc to something more recognizable...but hey...for my pruposes now it works and I am happy.

xbrotherx
02-12-2004, 11:11 PM
Wait, wait, wait. I tooted my horn too soon. It does not work as I want when I apply it to my application.

Please read two posts up and let meknow if this is possible.

thanks.:confused:

yorkeylady
02-22-2004, 03:21 PM
It's much easier for us to help if you post an fla. I've had a lot of trouble with scrollpanes not scrolling text correctly. So just did a work around.