Ask a Question related to Macromedia Flash, Design and Development.
-
ped #1
Dynamic font and colour changes to textbox
Hi NG,
I have a movieclip called: wordcontainer
and this clip contains a textbox called : wordtextbox
and I can set the movieclip to display a singlr word myWord as follows
Code:
wordcontainer.wordtextbox.text = "myWord";
I have found out how to dynamically create a new textformat as
follows:
Code:
//create a new TextFormat object
myTextFormat = new TextFormat();
//Next three lines passing the font type, size, and color
myTextFormat.font = "Celestial";
myTextFormat.size = 10;
myTextFormat.color=0xFF0000;
//applies this textformat to the "wordcontainer.wordtextbox" text box.
wordcontainer.wordtextbox.setTextFormat(myTextForm at);
so far so good, I can see that the movie clip behaves properly
I now try to duplicate this movie clip which also works properly:
Code:
for(i=0;i<5;i++){
name = "word" + i;
trace(name + " " + " " + _root.wordcontainer._width);
spacing = _root.wordcontainer._width +5;
_root.wordcontainer.duplicateMovieClip(name, i);
_root[name].wordtextbox.text = name;
trace(_root[name].wordtextbox.text);
_root[name]._x =(i*spacing) + 20;
_root[name]._y = 180 ;
}
the problem is that although the movie clip is duplicated this line
doesnt work:
_root[name].wordtextbox.text = name;
I havnt got a clue why its not working
I am trying to dynamically generate a list of words with specific font
, size and colour attributes
thanks in advance
ped
ped Guest
-
Alternate Dynamic Table Row Colour
I have managed to display dynamic data in a table in several web pages on my site. However, I would like to display alternate rows in a different... -
Dynamic textbox
Flash MX question: Is it possible to insert a variable inside a dynamic textbox with scrollbar? Like this: Your name is ?? thx, Diederik -
Textbox Font and Fontsize in Edit Mode
How do I change the textbox font and fontsize in Edit Mode? Thanks, -Dave -
html tags in dynamic textbox
Hi everyone I read a lot of messages here regarding problems approaching mine... but no solution. I have a dynamic textbox, whose variable name... -
How to stop font width expanding when textbox is resized
How to stop font width expanding when textbox is resized Hi, I am new to this Forum and to Fireworks MX. I am trying to create buttons and... -
Igor Cuckovic #2
Re: Dynamic font and colour changes to textbox
"ped" <pedmk801@yahoo.co.uk> wrote in message
news:f3b56016.0309110616.66efed66@posting.google.c om...hi> Hi NG,
I hope this helps
// default container
_root.wordcontainer.wordtextbox.text = "myWord";
//Code:
for(i=0;i<5;i++){
name = "word" + i;
//trace(name + " " + " " + _root.wordcontainer._width);
spacing = _root.wordcontainer._width -50;
_root.wordcontainer.duplicateMovieClip(name, i);
_root[name].wordtextbox.text = name;
// trace(_root[name].wordtextbox.text);
_root[name]._x =(i*spacing)+10;
_root[name]._y = 130 + (i * 35);
// formatting text
myTextFormat = new TextFormat();
//Next three lines passing the font type, size, and color
myTextFormat.font = "Verdana";
myTextFormat.size = 10 + i;
myTextFormat.color=0xFF0000;
//applies this textformat to the "wordcontainer.wordtextbox" text box.
wordcontainer.wordtextbox.setTextFormat(myTextForm at);
//applies this textformat to the dynamically generated "wordtextbox" text
box.
_root[name].wordtextbox.setTextFormat(myTextFormat);
}
It generates five objects with different text and size of text.
--
Chule
[url]www.uraa.com[/url]
[url]http://mls.f2o.org/nomadi[/url]
[url]http://newsgrupe.tk[/url]
Igor Cuckovic Guest



Reply With Quote

