Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




AS Text Formatting



I have a dynamic text animation that goes letter by letter. However, I want to make it more dynamic. Right now you can define the phrase, kerning, and interval between each letter appearing for each instance the animation is used. I want to define other things for each instance as well now, such as font, size, color, bold, underline, URL. So far I have the following: format = new TextFormat();format.font = fontType;format.color = fontColor;format.size = fontSize;format.bold = fontBold;format.underline = fontUnderline;currentTextField.setTextFormat(format); The color and size work, however all the others do not. I believe the reason the font does not work is because the font is not embedded. This is how the variables are defined on each movie clip: onClipEvent(load) {phrase = "This is the sentence to be displayed";kerning = -.1;timePeriod = 20; fontSize = 30;fontColor = "0xFFFFFF";fontType = "Verdana";fontBold = true;fontUnderline = true;fontUrl = "http://www.google.com"; } I don't understand why color and size work, while bold and underline do not. Any help is much appreciated!



SitePoint > Design Your Site > Flash and Actionscript
Posted on: Oct 14, 2003, 17:54


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Loss Of Text Formatting When Using Dynamic Text Field & Scroller
Hi all,

Using MX...

Another small problemo im having is when i format text in my dynamic text field and attch the scroller component to it, in preview mode i lose all the text format and it goes to the first text format it encounters and uses that for everything else in the dynamic text box.

Im not actually loading any text into the dynamic text box, im just using it with static text, so i can use the scroller component.(as i understand it, you can only attach the scroller component to a dynamic text box ??)

Why am i losing my text format AND is there a better way to have a scrolling text field when i just want to use static text...???

Thanks guys..hope thats not too confusing

Cheers

Dynamic Text/scroll Bar Component Changing Text Formatting
I would apologise if this has been answered before but I have done a quick search & was unable to resolve it & I'm up against a dead line.

I have a dynamic text field onto which I have placed a scroll bar component problem I have got is that the dynamic field has now lost all of it's formating -the header was orginally slightly larger & of a different font.

Anyone please tell me how to resolve this.

Thanks

Formatting Text Loaded From An External Text File
Hi:

I have a scrollable, dragable, mini-window that uses multilined, dynamic text updated from an external text file. I also have word wrap, selectable, and HTML enabled for the text.

My question is how do I format the text? Specifically, even though word wrap is enabled, the words are being cut off at the right border. How can I prevent this??? BTW, there is no masking involved, and the text is on the top layer. Also, I experience this same problem, whether the text is loaded from an external file, or if I just type it into the action panel.

Any help will be greatly appreciated.

http://www.atlantaroadcma.org/dragwin2a.html

James


If you confess with your mouth the Lord Jesus Christ, and believe in your heart that God raised him from the dead, you shall be saved.

Problems With Formatting Text In Input Text Fields...
I want to set up my cursor in input text fields to be white, because my backround is black.

Formatting Dynamic Text In A Text Box Can There Be Two Different Colors/styles ?
In the code below im loading variables from php that are pulled from a mysql db and printing them out. there is one From: Name then a newline with the message. they both go to the same dynamic text feild as you can see i set the color to black .. is there anyway i can make the from:name one color and the message another ? or maybe just have the from: name in bold ? if i set the textcolor to one color before the from line and another afterwards it changes the color of everything ?

Code:
myVars.load("testiflash.php");
myVars.onLoad = function( ){
trace("variables loaded");
}
myVars.onLoad = function( success ){
if(success){

testi.textColor = 0x000000;
i=0;
while (i<myVars.endmsg){
testi.text +="From:" +myVars["testiname" + i];
testi.text +="
" + myVars["testimsg" + i] +"

";
i++;}


}
}
any ideas ?
thanks in advance !

Rich Text Formatting In Referenced Text File
Hey all,

I'm trying to use external files for the text on this site. But I need to be able to put rich text elements in (bold and italic and such). In order to reference the files I followed the method outlined in Kirupa's tutorial ( http://www.kirupa.com/developer/mx/externaldata.htm ) however I can not figure out how to add rich text tags to this. I click on "render text as HTML" but the tags still just show up as text. Can anyone help me with this? Thanks in advance for any help.

To those responsible for this site: just want to express my apreciation for this site and all that it contains, it is by far my number one reference for flash tutorials. Keep up the excellent work.

Rich Text Formatting In Referenced Text File
Hey all,

I'm trying to use external files for the text on this site. But I need to be able to put rich text elements in (bold and italic and such). In order to reference the files I followed the method outlined in Kirupa's tutorial ( http://www.kirupa.com/developer/mx/externaldata.htm ) however I can not figure out how to add rich text tags to this. I click on "render text as HTML" but the tags still just show up as text. Can anyone help me with this? Thanks in advance for any help.

To those responsible for this site: just want to express my apreciation for this site and all that it contains, it is by far my number one reference for flash tutorials. Keep up the excellent work.

Formatting Text In A Dynamic Text Field Loaded From XML
I've got a mysql table that feeds content into a php script which then formats it as XML and then gets loaded into a dynamic text field in flash 8.
What i'm trying to figure out is how on earth do i format this xml so that when its loaded into flash the main blog article is in italics? (goto
http://www.jacksrambles.com and then click on the blog button)
Do i do it in the PHP script or in the actionscript in flash.
Heres my current actionscript:
Code:

var theXML:XML = new XML();
theXML.ignoreWhite = true;
news_txt.html = true;
theXML.onLoad = function(){
   var itemNodes = this.firstChild.childNodes;
   for(i = 0; i < itemNodes.length; i++){
      var date = itemNodes[i].childNodes[0].firstChild.nodeValue;
      var title = itemNodes[i].childNodes[1].firstChild.nodeValue;
      var body = itemNodes[i].childNodes[2].firstChild.nodeValue;
      news_txt.text += date +"
" + title +"
" + body +"


";
   }
}
theXML.load("http://www.jacksrambles.com/news.php");

And heres the PHP script:
Code:

<?PHP

$link = mysql_connect("localhost","username","password");
mysql_select_db("jack777_site");

$query = 'SELECT * FROM news';
$results = mysql_query($query);

echo "<?xml version="1.0"?>
";
echo "<news>
";


while($line = mysql_fetch_assoc($results)) {
   echo "<item>
";
   echo "<date>" . $line["date"] . "</date>
";   
   echo "<title>" . $line["title"] . "</title>
";
   echo "<entry>" . $line["entry"] . "</entry>
";
   echo "</item>
";

}


echo "</news>
";

mysql_close($link);

?>

Formatting Text Variable From Text File.
Just a stupid question...
I use a text file to populate a text area in a MC.
When I use CR in the file I get 2 CR in the movie.
How can I solve this..if I need only 1 CR in the text field of the Movie.

Thanx for your help..

Valmont

Formatting Text Inc. Colour From Text File
Hello, Does any one know if it is possible to format text i.e. new line, bold, change colour.... from text sent from a text file?

I've got a text field on my stage called main_copy and i am loading text into it from a text file... but i need the file to tell the text when to new line and have a different colour I know how to do it straight from flash...

i.e.

main_copy.htmlText = "<p>newline</P>";

but how do I pass these formating cues from a text file without flash thinking it is the actual text...

I'm running from a simple text file and using following naming structure....

&main_copy_var = text for main copy&main_copy_var2 = text for main copy2

etc....

can anyone help?

Formatting Text Inside A Dynamic Text Box
I am allowing clients to use notepad to update information on thier site. I just wondered the best way to set up that notepad file so that the text can be formatted.

Here is an example:

http://www.bushidodesigns.net/fc/dyn...ox/example.htm

Should I just set the file up as a html doc. (in notpad) and then just explain to my client how to use that? This is starting to be my biggest problem over all my clients. Something I need to figure out fast!!!!

Thnaks
- ZG

How To Strip Text Formatting From Text Field Value ?
Hi everyone,
Have tried to get some info on this but no luck.... I've created a simple contact form in Flash, but the URL which it's generating contains the text formatting from the text input fields. As a result the script that processes the mail send doesn't work. How do I strip the text formatting out of text1, text2 and text3 before I use getURL() ??

on (release) {
url_var = "your_name="+text1+"&your_e-mail="+text2+"&message="+text3;
getURL("contact.php?"+url_var, "_blank", "GET");
text1 = "";
text2 = "";
text3 = "";
}

Checking Text Formatting In A Text Field
I need to build a fairly basic word processor that will apply text formatting seperately to eah text field on the stage an onSetFocus to any given field you can change its particular options....then when you click back into that field-the buttons that where you toggle the formatting options; bold, italic, etc. highlight based on what you've already selected in this field.

I thought that if I used a single textFormat object, and cleared it after each apply, I could test each text field by saying something like

if (whatEverText.bold = true {
boldButton.gotoAndStop("on")} but it's not reading the formatting of the text field. Will I need a seperate textFormatting object for each field?

I could use a little direction from one of you pros!

Thanks

Text Formatting Problem In Dynamic Text Box
Hi,
I'm developing a quiz, storing player details in a multidimensional array which holds player objects containing rank, name and score. The name is entered via a text input box in one frame and rank, name and score are later dislayed in dynamic text in a textfield in another frame. Rank, name and score should then be displayed in that order on a single line for each player in a scrollable text field. The problem I have is that the name appearing in the textfield appears to carry with it a new line command so that the third item of information on what should be one line (the score) is outputted on a separate line underneath. I have checked the various properties in the input field (I'm not entering it as html) and can see no reason for this. Any ideas on what I am doing wrong?

Checking Text Formatting In A Text Field
I need to build a fairly basic word processor that will apply text formatting seperately to eah text field on the stage an onSetFocus to any given field you can change its particular options....then when you click back into that field-the buttons that where you toggle the formatting options; bold, italic, etc. highlight based on what you've already selected in this field.

I thought that if I used a single textFormat object, and cleared it after each apply, I could test each text field by saying something like

if (whatEverText.bold = true {
boldButton.gotoAndStop("on")} but it's not reading the formatting of the text field. Will I need a seperate textFormatting object for each field?

I could use a little direction from one of you pros!

Thanks

Input Text Trace Gives All Text Formatting
a friend of mine has this weird problem w/ an input text field box. They type in a number, say 33, then trace the content and they get all the formatting, not just 33.

<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="_sans" SIZE="15"
COLOR="#000000" LETTERSPACING="0" KERNING="1">33</FONT></P></TEXTFORMAT>


I can't repro the issue and I don't have their code.

My question is 2 part:

1 - what are they doing to get all that formatting? Sounds like it could be useful if you wanted to mess w/ it on purpose ...

and

2 - how do they turn it off?

Text Formatting For Dynamic Text Field
Hi,
I got that to work...thanks for your help!

However, I do have a few more questions:

First:

I have an input text field, a dynamic text field, and three buttons that allow the user to change the font of the data in the dynamic text field. I can input text in the input text field, and click submit, and that text appears formatted in the dynamic text field. Then I can change the font of the text in the dynamic text field using the three buttons. However, when I go back to input new text, it does not remember the formatting and font. In other words, If i go back to input new text, that text then appears in the dynamic text field, but the formatting resorts to the original formatting of the text field itself. Can you help?

Second:

I want to somehow limit the amount of text that will appear in the dynamic text field. Is there a way to add a script to the dynamic text field so that it can detect when the last character can fit in the field, so no characters extend out of the field, and so that none are half in and half out of the field? I don't really want to set maximum characters, because then one user can input all caps, and another all lowercase, and the size of that would be significantly bigger? What should I do?

Thank you very much!

Text Field Formatting And Text Handling
Hi,

I have a few things to ask on this topic and I hope someone can help me with the following:

1) I need to load a HTML file in a text field with AS3. So far, I managed to do quite well but I have an issue with the line spacing.
I don't know how to make that smaller. I can change the font and everything else but I get a ridiculously high space between lines.
Is there a (possibly easy) way to change that?

2) Is it possible to read from a text file but line by line? What I have achieved in the previous point is to load the whole file in the text field but I'd also like to read each and every line separately and put it in different text fields.

3) Can anyone recommend a good, comprehensive book on AS3?
I went to some bookshops in London and there seem to be a lack of choice on this subject. Is it too early?
I found ActionScript 3.0 Cookbook (O'Reilly) but that seem to be thought for Flex mainly and I don't know how to run the sample code in Flash CS3...

Thanks a lot.

Formatting Text
Hi,

I want to reuse variables as text in a project.
The structure is as follows:

On _level0 the variables are declared and used in a dynamic textfield. The words should apear on multiple lines so the variable looks like this: wachter="wachter
beton
1995"
or torso="torso
schapenhuid
1996"

Now it want to use the variables in a loaded movie but here they will have to appear in a single line.

Is the a way to:
1) get rid of the
so the text will be shown in a single line ?
2) retrieve the first word after the = ? (I want to use that to load an swf by that name.)

I've been trying to figure it out for the passed couple of hours and now I give up. So I would appreciate any comments or advice.

Thanks in advance.

Regards, Danielle.

Formatting Text
Does anybody know how to control what characters entered into a textfield. I have a problem with the ' character when saving to a database through an asp-script. Does it goes for a special character or something?

Text Formatting
Hello guys I´m posting here for the first time so be gentle. I´m doing a website in Flash(my first one), and its for this pizzaplace. I have to have the kind of pizza, the size and the price. If I was doing it html I would just use tables, since Flash doesnst have tables I´m in some trouble because the text must scroll and ****. And I have to put the text in through scripting so it will scroll. Any suggestions

Text Formatting
Searched this forum up and down now but I still can't get this stuff working...

I'm loading some stuff from XML.
Works fine until characters like "'" and "&" show up....

Tried with the escape() and unescape() but no luck...

Text Formatting
can anyone help me with the following formatting problems:

I recently tried to dynamically create bulletin points - I display various external text files in 1 textfield and therefore was not very happy to use the newTextFormat method as I will need to check the bulletins points position within the text file each time
I then just tried to code the HTML list format tags into the external text files:

<BLOCKQUOTE><UL STYLE="CIRCLE">
*text>/li></UL></BLOCKQUOTE>

and although it did not create the bulletin point, it at least intended the text ... is there a way to hardcode bulletin lists in the external text files ?? ... or any other simple way around that??

my other question is ... i want to use images and text files together, similar as used on "news" sites ... with xml I had the problem that in a node if I tried adding longer texts (eventually even with line breaks) it couldn't read the file anymore ... can anyone suggest a solution to that without formatting it directly into flash

please help :-}

Text Formatting
can anyone help me with the following formatting problems:

I recently tried to dynamically create bulletin points - I display various external text files in 1 textfield and therefore was not very happy to use the newTextFormat method as I will need to check the bulletins points position within the text file each time
I then just tried to code the HTML list format tags into the external text files:

||BLOCKQUOTE || UL STYLE="CIRCLE" || li ||
text
|| /li || /UL || /BLOCKQUOTE

and although it did not create the bulletin point, it at least intended the text ... is there a way to hardcode bulletin lists in the external text files ?? ... or any other simple way around that??
my other question is ... i want to use images and text files together, similar as used on "news" sites ... with xml I had the problem that in a node if I tried adding longer texts (eventually even with line breaks) it couldn't read the file anymore ... can anyone suggest a solution to that without formatting it directly into flash

please help :-}

Formatting Text
Hi experts,
I want a simple Q answered in flash.

How to make text stored to variable in dynamic Text bold/italic. Or for that matter do any kind of formatting. I am asking about text stored in a variable using actionscript and not by formatting text in workspace area.

Text Formatting
Hi,

Is it possible to change the formatting of some of the text to be different than the rest of the text in the same Text Field or do they have to have the same formatting throughout the field?

Thanks in advance,
David

Formatting Text
i'm making a dynamic text box with actionscript....

code:
_root.createTextField("text",100,118,66,95,52);
text.background=true;
text.border=false;
text.backgroundColor=0xffffff;
text.borderColor=0;
text.multiline=true;
text.wordWrap=true;
text.variable="field1";
//Format
field1Format = new TextFormat();
field1Format.font = "Arial";
field1Format.size = 12;
field1Format.color=0x000000;

text.setNewTextFormat(field1Format);
loadVariables("art.txt", "_root");

it is in the format that i have probs. anyone knows what should i type to embed the font?

i've tried code: field1Format.font=embed;//just guessing but of course it didn't work.

anyone please help me.
thanks

Text Formatting< Im Sure U All Want To Know Too
How do we format text, with underline, tab settings etc like in WORD. I find this very limmiting in my text presentations in FLASH


www.inbond.us
www.vibetribe.org
www.directbusinessinsurance.com

Help With Formatting Text
I am using a dynamic text box to dislpay text from an external text file using instance name, now i am having a problem with it, is there any way i can display links in the text by formatting or including some special tags in external file ?

Lil' Help...text Formatting
I'm trying to format numbers to be used as currency...

...like 83.3425 to print out as 83.34

...or 83.3456 print out as 83.35

Many thanks in advance.

Text Formatting
Wondering why my text won't wrap when creating a text field from actionscript.

View problem here: www.thetradeonline.com
Click Band.

on root:

Code:
_root.typewriter = new TextFormat();
_root.typewriter.size = 12;
_root.typewriter.color = 0xFFFFFF;
_root.typewriter.font = "TypewriterOldstyle";

in band clip

Code:
this.createTextField("description", 1, 285, 235, 100, 140);
this.description.text = _root.editor3Vars.description_1;
this.description.embedFonts = true;
this.description.setTextFormat(_root.typewriter);


I have debugged the movie and the returned data string is showing up in the clip, however it just isn't wrapping.

url of data source:
http://www.thetradeonline.com/script...d1=description

returned data string:
&num_entries=1&description_1=The%20Trade%20blends% 20intensity%20and%20sweetness%20into%20a%20rich%2C %20dark%20modern%20sound.%20Front-woman%2C%20Robin%20Wedlock%2C%20has%20an%20incredi ble%20voice%20that%20glistens%20above%20super%20to nal%20guitar%2C%20sensual%20bass%2C%20and%20primit ive%2C%20grooving%20drums.%20The%20Trade%27s%20sou nd%20comes%20across%20as%20a%20perfect%20unit%2C%2 0far%20ahead%20of%20our%20time.%3Cbr%3E%3Cbr%3EThe ir%20newest%20release%2C%20I%20Mi%20Lunasa%2C%20is %20an%20enhanced%20EP%20featuring%20their%20video% 20to%20the%20radio%20mix%20of%20%22August%22%2C%20 lyric%20pages%2C%20a%20cool%20trendy%20commercial% 2C%20and%20access%20to%20the%20band%27s%20website. %20The%20Trade%20has%20been%20topping%20th%20chart s%20in%20commercial%20and%20college%20radio.

Formatting Text
I have a guesbook type application
It updates to a MySQL database using php
I then read it out, formatted with html so flash can read it in.
When i read it into flash, if i've formatted the text at all using <b> etc..it wont show up in flash
The dynamic text box in flash IS behind a mask...But I have the font outlines embedded...So I'm not sure what's going on.
Eric.

Please Help Me With Text Formatting
Ugh!
I want to make a bulleted list with a title and I can't figure out how to do it! The entire dynamic text box is bold, no matter what I do! I just want the title to be bold and in blue and then the stuff underneath to be grey and bulleted. I just can't figure it out. Does anyone have code that would help me? I am at my wits end!!!!!!! I have the dynamic text box named myText and then the code I have tried to do, but it just doesn't work.

This is my code:
myText.html = true;
myText.htmlText = "this is where I get lost!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Text Formatting?
Hi,

I'm working with Static text and the formatting that I apply looks great, but when I publish, or test, it changes....can anyone help with this problem? I don't want to convert it to a graphic, so I can edit it later if I need to.

Thanks

[CS3] Text Formatting Changes
I'm using AS2.0, and have made a dynamic textbox (inserted "graphically" onto the stage) with some starting text in Arial Bold (set in the parameters box).

However, when I later in the program change the text using button.text = "myText", the formatting changes. From what I can see, it's still Arial, but not bold. Do I have to specify this everytime I change the content text? Seems wierd if so.

Thanks a lot!

[CS3] Text Formatting
Other than using the html approach with actionscript are there any ways of getting expanded text formatting in Flash? Any plugins that allow you to do bulleted lists and improved spacing control?

Thanks for any information.

Text Formatting In XML
How do I control text formatting like bold text, itlalics, etc. in Flash when my text source is in an XML document?

Text Formatting
hi,

I've got a movie that reads all text from an external <XML> file.

How can I format the text, so headlines etc. will appear in different styles.

I have tried using <HTML> formatting, but I can't get it ot work.

Thanks in advance for any help.

TBX...

Formatting Text
I am trying to format text pulled in from an external file and I'm not having much luck. I also want to know if I can replace the default button component with my own image and still be able to use the Next and Previous actions in the code. If so, what do I need to change in the code. I've pasted the code I'm working with below. Any help would be greatly appreciated. Thanks in advance.

var myCSS = new TextField.StyleSheet();
var cssURL = "myStyle.css";
function loadEntries(act, increment) {
// Define NumLow as a Number
num = new Number(_parent.NumLow);
// Act accordingly
if(act == "Next") {
// Add increment
_parent.NumLow = num + increment;
} else if(act == "Previous") {
_parent.NumLow = num - increment;
} else {
// Load default - i.e. 0
_parent.NumLow = 0;
}
// Update Statistics
_parent.read.low.text = _parent.NumLow;
_parent.read.high.text = Number(_parent.NumLow) + 1;
// Show Please wait text
_parent.read.entries.text = "Loading entries... Please wait...";
// Begin Loading
myEntries = new LoadVars()
myEntries.ref = this
myEntries.load("mydata.php?action=read&r="+random( 999)+"&NumLow="+_parent.NumLow);
myEntries.onLoad = function(success){
if(success){
// Assign output to components and objects
entries.text = this.entries;
totalEntries.text = this.totalEntries;
//Update values to calculate prev/next button visibility
num = Number(_parent.NumLow)
var totalEntries = Number(this.totalEntries);
var total = num+increment
//Hide/show next button
if(total<totalEntries) this.ref.next_button._visible = true;
else this.ref.next_button._visible = false
//Hide/show previous button
if(num==0) prev_button._visible = false; else prev_button._visible = true
}
}
}
// Load Default
_parent.read.loadEntries("Default", 1);
stop();

Text Formatting
I have some input boxes but they are set up to be like a "fill in the blank" with spaces. So I just added kerning so the characters line up with the blanks, but when you actually start typing (if there are no characters already in the textfields) the kerning is gone and it goes to default. And especially when I go back to those frames later and load the inputted text back into the box, the spacing is gone.

I looked in Flash's API and all it said was kerning was a boolean property - I set it to true in the loading function, but it didn't make any difference.

Is there any way to actively maintain the kerning set on the textfield properties in Flash?! I know this is easy but I can't figure it out.

Brad

XML Text Formatting
I have a simple XML document that I am loading and parsing into flash. The data is then used for insertion into an HTML Text field. It all works very well - however - I need to be able to apply simple html formatting into the text contained in the XML file before it's loaded into flash. for example:

<myText>
This is text to be loaded into HTML Filed in Flash
</myText>

I would like to apply HTML tags to the the text as follows:

<myText>
<b>This is text to be loaded into HTML Filed in Flash</b>
</myText>

but this is XML not HTML so it is read as though you've just created a new XML node, so I have to fool it into thinking it's just another character. Like this:

<myText>
*This is text to be loaded into HTML Filed in Flash**
</myText>

So now my Question is the "decoding" of this once it is read into flash.

Using Actionscript how can I decode * as <b> and ** as </b>?

Detect if the Character "*" is detected is will strip it and replace it with "<b>" and so on. ( the "*" could be any uncommon char really.)

Please help!

Text Formatting
After all the stinking examples I have scrolled through I don't see how I am messing up. However, my text box doesn't want to accept the new formatting. What am I doing wrong?


Code:
createTextField("mytext", 999, 10, 10, 80, 50);
mF = new TextFormat();
mF.font = "Arial";
mF.color = 0x0000FF;
mytext.setTextFormat(mF);
mytext.wordWrap = true;
mytext.text = "it's Wednesday afternoon";

Formatting Text
Hi everyone,

Could anyone help me, please?
I need to place text inside a movie clip in such a way that when I click on any word in the text I get that word and place it in a textbox along with some information about that word (definition of the word, for example). I tried to do that by splitting the text and put each word in a separate movie clip. It works fine but it involves a lot of coding. It needs using TextFormat, getTextExtent, and string functions. The most difficult part is placing the movie clips so that they look like normal text. Is there an easier way to do the same thing?
Thanks.

Text Formatting
I am trying to create a user friendly way of formatting my input/html text box in flash for a website admin section:

I need to be able to select a word or group of words from the loaded text in the text box and if I click one of the three buttons located below have it do the following:

Button 1 - puts a {b} beofre the selection and a {/b} after the selection or word(s)
Button 2 - puts a {I} beofre the selection and a {/I} after the selection or word(s)
Button 3 - puts a {u} beofre the selection and a {/u} after the selection or word(s)

Yes the above letters should be placed inside [ ] instead of { } but I could not do that on here.

Can someone please create a code that will complete this action?

Thanks In Advance - Bryan

Text Formatting
I know in Illustrator there's a "smart punctuation" setting where you can set it so an apostrophe will be typed as a real apostrophe and NOT a foot mark. I can't seem to figure out how to do this in Flash.

Does anyone know?

Formatting Text
Can anyone tell me how to set the text properties for the code below. I need to set it to Arial and change its size. Thank you.







Attach Code

/*
Count Down Timer
T. Norman
http://ntdesigns.net
*/
function countDownTimer(minute, tX, tY) {
_root.createEmptyMovieClip("countDown",10);
cCenterX = tX;
cCenterY = tY;
_root.countDown.counter._x = cCenterX;
_root.countDown.counter._x = cCenterY;
_root.countDown.createTextField("myTextField", 1, cCenterX, cCenterY, 30, 20);
_root.countDown.myTextField.background = false;
_root.countDown.myTextField.autoSize = "center";
_root.countDown.myTextField.border = false;
_root.countDown.myTextField.backgroundColor = 0x00FFCC;


minute = minute;
seconds = 59;
myCountDown = function () {
seconds--;
};
countInterval = setInterval(myCountDown, 1000);
this.onEnterFrame = function() {
if (seconds<10) {
_root.countDown.myTextField.text = minute-1+":"+"0"+seconds;
} else {
_root.countDown.myTextField.text = minute-1+":"+seconds;
}
if (seconds === 0) {
clearInterval(countInterval);
seconds = "0";
minuteDelay = setInterval(minuteChangeDelay, 1000);
}
if (_root.countDown.myTextField.text == "0:00") {
delete this.onEnterFrame;
_root.countDown.myTextField.text = "0:00";
}
}
minuteChangeDelay = function () {
minute--;
seconds = 59;
countInterval = setInterval(myCountDown, 1000);
clearInterval(minuteDelay);
}
}
//Usage..... functionName(minutes,x position,y position)
countDownTimer(1, 400, 200);

Formatting XML Text
Hi. I've been trying to figure out XML in flash and found a (old) tutorial that worked for me. i want to format the text using html tags. I have found other tutorials on this claiming it's easy using CDATA, but i can't get it to work with mine. It either shows the text with the tags, or NULL when i add it wrong. I understand i need to add bold fonts, etc, but i'm adding the code wrong.

If this IS simple (or even possible), will someone help and show where it needs to be placed in the code? Any help at all is appreciated.

Thanks.







Attach Code

<?xml version="1.0"?>

<name>
<person>
<name>NAME</name>
<comment>FIRST TEXT GOES HERE.</comment>
</person>
<person>
<name>NAME</name>
<comment>SECOND TEXT GOES HERE</comment>
</person>
</name>

ACTIONSCRIPT:

function loadXML(loaded) {
if (loaded) {
_root.names= this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
_root.comments = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
name_txt.text = _root.names;
comment_txt.text = _root.comments;
} else {
trace("file not loaded!");
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("names.xml");

Formatting Xml Text
hi. i'm trying to format xml text with html tags. i've searched this forum and read some of the previous threads but still am a bit lost.

here's a variable i create to hold the text i have in a [CDATA] tag:

ActionScript Code:
instructionsText = unescape(stripSpaces(node.firstChild.firstChild.firstChild.nodeValue));

then later on i create a text field to put that variable in, i.e.:

ActionScript Code:
// display instructionsich.createTextField("inst", 998, 0, -10, 520, 40);inch.inst.renderAsHTML = true;ich.inst.text = instructionsText;ich.inst.multiline = true;ich.inst.wordWrap = true;ich.inst.selectable = false;ich.inst.setTextFormat(new TextFormat("Arial", 11, 0));

what am i missing? i thought this was the right way to do it...???

thanks. fumeng.

Text Box Formatting
Is there a way to centre text vertically aswell as horizontally within a dynamic text box?

Please let me know either way.

Xml Text Formatting
There are a thousand threads on this, and I've been reading them, but I still can't get my text from an xml file to format correctly with html tags. I've tried CDATA tags and plain old <b>, <i> tags and I get errors with both. When I use the regular html tags, the whole text field reads as "null", and when I use the CDATA tags, it bolds everything except the text in the italic tag, which doesn't show up at all. Any clues as to what I'm doing wrong?

Here is my xml code:

Code:
<pic>
<image>image1.jpg</image>
<title>TITLE QUESTION?</title>
<caption><![CDATA[<b>Here is<b/> <i>text that doesn't show up</i>and this shows up bold even though there's no tag.]]> </caption>
<thumbnail>image1_th.jpg</thumbnail>
</pic>
Here is my flash code:

f
Code:
unction nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
title_txt.text = title[p];
desc.html = true;
desc_txt.htmlText = description[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
title_txt.text = title[p];
desc.html = true;
desc_txt.htmlText = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
title_txt.text = title[0];
desc.html = true;
desc_txt.htmlText = description[0];
picture_num();
}
}

Copyright © 2005-08 www.BigResource.com, All rights reserved