This should be easy but I'm have a hard time figuring it out. I have some acrionscript calling info from an XML file. That all works good and fine, thanks to the great help I have found on this message board! The problem is when I make the dynamic text box in to a movie clip so it moves around it no longer display the text cause it's no longer on the _root. How do I get that clip to call to the AS back on the root? thanks.
Thanks for the reply but...
nothing really refers the the movie clip itself, It's the movie clip im trying to get to refer back to the first frame on the main movie.
-------------------------
function showText(newText){
txtBox = rootNode.firstChild.attributes.title;
-------------------------
is where the text is placed into the dynamic text box
but the text box does not exist on the _root timeline. it is now in a movieclip and you need to do what i said and change the as to something like
------------------------
function showText(newText){
_root.mymovieclip.txtBox = rootNode.firstChild.attributes.title;
------------------------
or give the text box an instance name AND the mc an instance name, then put the text directly into the dynamic text box
------------------------
function showText(newText){
_root.mymovieclip.mydynamictextbox.text =
rootNode.firstChild.attributes.title;
------------------------
i guess the thing i am trying to say is that your function is operating on the _root and your textbox is not there so it will never put the text into the box. you have to name the mc and (poss) the textbox so that you can reference them in the function.
that way flash will know exactly what you want it to do.
phew....what a reply....lol
try it see what happens. when i am doing stuff like this i use the insert target button to "find" my target. then i watch the values using the debug tool.
cheers
gary
I bought a Ouija board. The pointer spelled out 'You don't actually believe in this crap, do you
when I run the movie it displays "_level0.myClip.txtBox"
this happens when you have the same instance name and variable name for the textfield, and then scope variables to the textfield's instance name...still with me ??
use - with variable name ONLY
_root.myClip.txtBox = rootNode.firstChild.attributes.title;
or - with instance name ONLY
_root.myClip.txtBox.text = rootNode.firstChild.attributes.title;
Yeah, I thought thats why it was giving me that output, I had ran in to that before when working with dynamic text. However either way I try it - with a varible or an instance alone im getting no out put at all. Should I have an action in the movie clip it self that calls back to the _root level? Thanks
OK, maybe this isn't so 'simple' cause that's not working either... I can get it to work if I put an action in the movie clip it self that calls the XML file and what not again, but I wanted to aviod that to keep the file size down and make it easy to edit if I ever need to... grr... i'm so stumped, I do appreciate all the help by the way.
your myXML.onLoad passes the text variable to the textfield in the movieclip on frame 1.
but your movieclip does not appear until frame 5, so it will not receive it.
alter your code -