[thelist] dynamic text boxes

shortestpath shortestpath at yahoo.com
Thu Sep 4 21:55:58 CDT 2003

what do you mean by TextField.variable? Maybe show us 
your code and we can try it out? Here's an example of 
creating a textfield, and setting/unsetting its text 

<script type="text/javascript">
function createTxtfld() {
	var tf = document.createElement("input");
	tf.setAttribute("type", "text");
	tf.setAttribute("id", "txtfld");
	tf.setAttribute("style", "width:180px");

	var f = document.forms[0];

function makeBold() {
	var tf = document.getElementById("txtfld");
	tf.style.fontWeight = "bold";

function makeNormal() {
	var tf = document.getElementById("txtfld");
	tf.style.fontWeight = "normal";
<style type="text/css">
button { display: block; width: 120px; }


<form id="theForm">
<button onclick="createTxtfld()">create textfield</button>
<button onclick="makeBold()">make bold</button>
<button onclick="makeNormal()">make normal</button>



--- Mark Joslyn <Mark.Joslyn at SolimarSystems.com> wrote:
I in a little bit of a bind...

I have a dynamic text box (field1) that is inside a movie clip 
that is populated from an external .txt file. Everything is loading
perfectly, Now comes the tricky part - I want to now add formatting to 
text. I want the text to come in bold. Then when a user clicks a 
button, the
bold is turned off.

I cannot get the dynamic text box to accept any formatting commands. It
seems like the only way to get formatting to work is if I created a 
text box
with actionscript instead of drawing one on the stage.

I have tried setTextFormat, but this seems to be ignored. Also, through
testing, the TextField.variable command is quirky. I have one movie 
uses TextField.variable and works fine, and I have another that uses 
exact same code, and it does not work - it requires an "_" to work 
TextField._variable). Has anyone else experienced this "bug".

Is there a way to get a dynamic text box - that is drawn on the stage -

accept new formatting commands (bold, color, size) - without using HTML
commands in the external text file (I want to keep the external text 
super user-friendly - non-HTML users - for editing purposes)?

Any and all help appreciated.


Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

More information about the thelist mailing list