getting edit path of text in buttons using actionscript?
Dear All,
I wanted to change the colour of text within buttons, but could not get the name to use with the text object scripts - using the instance name of the button would not work.
Someone suggested using the debug:list objects to get the instance name. This worked, however should one naviagte around from screen to screen the instance names change. Not good! Also hand doing this for each button would not be efficient.
So is there a way of actionscript getting the target path of the text object within a button?
trionik. I'm not using the component button objects. I think that is required for this to work? Does it work if the text is set to html?
Any further advice?
I tried your first script whcih worked on comonent buttons. However I'm not using component buttons.
I've tried using that (hence the textFormat menthods mentioned in the question.
I can't get the target path of the dynamic text to place in my button instance. I can get it from the debug, list objects. but this value as shown in the output panel (ie
"Button: Target="_level0.mybutname"
Edit Text: Target = "_level0.mybutname.instance35".) is only kept the first visit to that screen, it changes there after. Also one would not wish to have to get the values from debug. One wishes to get flash to get the value and place it in the code you listed at runtime.
That's why jrh over at macromedia.com suggested using the debug output window to find the actual edit text instance. Which does work, but it can't be used as it assigns the values as the swf plays from screen to screen. (Actually I've just noticed each time the pages are revisited the instance value goes up by the original value ie. 3,6,9, etc!!)
Thanks for looking at this. Try it. Let me know if there is something I've missed! But I'm pretty sure this is a macromedia flash apin in the ***.
here is a file to show you what I mean. If you debug, you'll find the flash assigned instance, that keeps changing as the gotoframe 1 effectively moves one around the "site".
It does not have the mybut.mytext value.
Again let me know if you have any joy sorting this one. maybe rewrite the file!!!
Cheers
Steve
(file in 7.2 I've never attached here before so I hope this works!).
I should have stipulated that I need this to work with buttons. Accessibility issues mean that one has to use buttons for buttons not movie clips. Something to do with the way accessibility works with browsers and other software like screen readers.
Did you find the same result as me r.e. the textformat object controls not working for the button? And see the instance name flash assigned when using debug?