emptyMCInstance.btn.btnLabel.text = "foo";
Don't use a variable assignment for a text field, set it directly.
That super-old hat.
On Dec 1, 2005, at 12:05 AM, Azinger, Richard wrote:
Hello Flashcoders,
I'm trying to make a game that reads a XML file to build the
interface.
The game play will be the same every time but the look will be
different.
I get the swf files to load using MovieClipLoader and
createEmptyMovieClip but now I'm trying to change the text that's
on the
button. Everything works in the code except changing the label.
The selectBtn.swf is a button movieClip with the instance name of
'btn'.
On the button is a dynamic text field with the instance name of
btnLabel
with the Var set to btnLabel also.
I'm doing it this way because I don't know how many buttons will be on
any one frame.
Any help will be appreciated. Thanks,
Rich
XML
====================================================
<selectBtns btnSWF="selectBtn.swf">
<btn id="1" label="One Player" x="50" y="490" w="200" h="50" />
<btn id="2" label="Two Player" x="200" y="490" w="200" h="50" />
</selectBtns>
====================================================
MovieClipLoader
====================================================
selectBtnSWF = tempNodes[i].attributes.btnSWF;
for(k=0;k<tempNodes[i].childNodes.length;k++){
var mcBtnLoader:MovieClipLoader = new MovieClipLoader();
tempBtnName = "selectBtn_"+k;
somedepth = _root.getNextHighestDepth();
_root.createEmptyMovieClip(tempBtnName, somedepth);
this[tempBtnName]._x =
tempNodes[i].childNodes[k].attributes.x;
this[tempBtnName]._y =
tempNodes[i].childNodes[k].attributes.y;
mcBtnLoader.loadClip("images/"+selectBtnSWF,
tempBtnName);
this[tempBtnName].btn.btnLabel.value =
tempNodes[i].childNodes[k].attributes.label;
}
=====================================================================
This communication is for use by the intended recipient and contains
information that may be Privileged, confidential or copyrighted under
applicable law. If you are not the intended recipient, you are hereby
formally notified that any use, copying or distribution of this e-
mail,
in whole or in part, is strictly prohibited. Please notify the
sender by
return e-mail and delete this e-mail from your system. Unless
explicitly
and conspicuously designated as "E-Contract Intended", this e-mail
does
not constitute a contract offer, a contract amendment, or an
acceptance
of a contract offer. This e-mail does not constitute a consent to the
use of sender's contact information for direct marketing purposes
or for
transfers of data to third parties.
Francais Deutsch Italiano Espanol Portugues Japanese Chinese
Korean
http://www.DuPont.com/corp/email_disclaimer.html
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders