Formatting Text From A .txt Doc In A Text Field
Formatting text from a .txt doc in a text field.
Is this possible?
Everytime a new line occures within the .txt doc I get a double space in my text field. I would like a single space? When I type the text as a single line within the .txt doc, allowing WorkWrap to take effect, the result is single spacing within the text field. My problem is that I want to achieve something like the following:
Title of List (double space here) (indent)This item (indent)That item (indent)Another item (indent)Last item
Is there a way to do this, and if so, how?
FlashKit > Flash Help > Flash ActionScript
Posted on: 04-15-2003, 07:39 PM
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
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);
?>
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
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 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 Field Using Css
is there a way to format static text fields using css......
my static text field named "bodytext" already contains text......and on run time i load the css into a field new TextField.StyleSheet of instance name "cssformat", after which i want to change the text format of the text field "bodytext" to the css class "bodytxt" contained in the css "css format"....but for this am unable to find any documentation any where so kindly tell me if its possible.....
Thanx in advance
Formatting Text Field Using Css
is there a way to format static text fields using css......
my static text field named "bodytext" already contains text......and on run time i load the css into a field new TextField.StyleSheet of instance name "cssformat", after which i want to change the text format of the text field "bodytext" to the css class "bodytxt" contained in the css "css format"....but for this am unable to find any documentation any where so kindly tell me if its possible.....
Thanx in advance
Formatting Text In A Text Field
I posed a question before about using scrollbars with Flash 5. I have the code to create scrolling text but I'm not sure how to format text with linebreaks intact. The text is a series of questions so I need a linebreak after each question. The code in the action panel looks like the following:
text = "Q: Is the LVEM5 an electron microscope or a light microscope? Q : Are there any specimen preparation considerations unique to the LVEM5?Q: Is the LVEM5 a new product? What can attest to its performance and robustness?Q: Who is Delong ? Why haven't I heard of them before?Q: Where can I find someone to speak to about my particular needs? (etc..)
";
Any suggestions?
Dynamic Text Field Formatting
Its not so much of a problem but more of a question. I have a dynamic text field and i can scroll it using the text.scroll functions. All works nicely. the text is stored in a variable named "text".
Now is it possible to format the text in the variable e.g make it bold, center, size. What i want is different sections with different formatting. I think it can because when i past a formatted text into the variable it puts funny code like
rThis is some text
This is some text put after a paragraph
does anyone know the formatting for
Bold
Center
Size
Dynamic Text Field Formatting
Its not so much of a problem but more of a question. I have a dynamic text field and i can scroll it using the text.scroll functions. All works nicely. the text is stored in a variable named "text".
Now is it possible to format the text in the variable e.g make it bold, center, size. What i want is different sections with different formatting. I think it can because when i past a formatted text into the variable it puts funny code like
rThis is some text
This is some text put after a paragraph
does anyone know the formatting for
Bold
Center
Size
Formatting Text In A Dynamic Field
i have a text field that loads data from an external file. are there some ways of formatting the text as far as spacing and stuff goes? for instance, i want to insert a tab between certain info in the text to make it like a chart kind of.
let me know if you have any ideas. later
Josh
Form Field Text Formatting Help
hello guys and a happy new year
I have once again started tinkering about with another part of my site. the form fields for contact, postnew(forum), postMsg(siteinbox) I am trying to take away the basic formatting sys i have
code:
//Bold but
msgfield.text+=msg+" <b>type bold text here</b>"
Pretty much the same for italic and underline.
Now i have seen a form field somewhere that when you high-light the text and then press the B button and the text gets formatted.
I tried downloading a couple of the text editers from flashcomponents.net but i am still none the wiser.
Anyone know how i can do this
Cheers
Paul
Form Field Text Formatting Help
Hi guys i made a post about this today but didnt get anywhere. i have since got a bit further but still running into problems. i have attached an fla So you can see the problem. I seem to be losing the focus once i press one of the format buttons.
This is not my code more a selection of posts that i have read up on this subject.
code:
myTextFormat = new TextFormat();
myTextFormat.bold = false;
myTextFormat.italic = false;
myTextFormat.underline = false;
//
textToEdit = msgfield;
Selection.setFocus(textToEdit);
//
function selectText() {
selectedText = Selection.getFocus();
//
trace("textfield path= "+textToEdit);
trace("current select= "+selectedText);
//
if (selectedText == textToEdit) {// Cant seem to get behound here
begin = Selection.getBeginIndex();
end = Selection.getEndIndex();
cursor = Selection.getCaretIndex();
currentFormat = textToEdit.getTextFormat(begin, end);
}
}
//Bold button
b_bold.onRelease = function() {
Selection.setFocus(textToEdit);
Selection.setSelection(begin, end);
myTextFormat = currentFormat;
if (b_bold._currentframe == 1) {
b_bold.gotoAndStop(2);
myTextFormat.bold = true;
textToEdit.setTextFormat(begin, end, myTextFormat);
} else {
b_bold.gotoAndStop(1);
myTextFormat.bold = false;
textToEdit.setTextFormat(begin, end, myTextFormat);
}
};
// Italic button
b_ital.onRelease = function() {
Selection.setFocus(textToEdit);
Selection.setSelection(begin, end);
myTextFormat = currentFormat;
if (b_ital._currentframe == 1) {
b_ital.gotoAndStop(2);
myTextFormat.italic = true;
textToEdit.setTextFormat(begin, end, myTextFormat);
} else {
b_ital.gotoAndStop(1);
myTextFormat.italic = false;
textToEdit.setTextFormat(begin, end, myTextFormat);
}
};
//Underline button
b_und.onRelease = function() {
Selection.setFocus(textToEdit);
Selection.setSelection(begin, end);
myTextFormat = currentFormat;
if (b_und._currentframe == 1) {
b_und.gotoAndStop(2);
myTextFormat.underline = true;
textToEdit.setTextFormat(begin, end, myTextFormat);
} else {
b_und.gotoAndStop(1);
myTextFormat.underline = false;
textToEdit.setTextFormat(begin, end, myTextFormat);
}
};
stop();
Function selectText()
code:
onClipEvent (mouseUp) {
_parent.selectText();
}
Cheers
Paul
Formatting Text Field, I'm Doing It Wrong?
I'm making the move to AS 3.0, finally, and I'm running into troubles with formatting a text field created in AS. It loads the text fine, but it does not format it properly. What am I missing? Just an FYI, the text field is being created against a black background, hence the white text and border. Help!
Attach Code
stop();
//----VARIABLES
//TEXT FIELD
var txtWhat:TextField = new TextField();
//TEXT FORMAT
var txtBody:TextFormat = new TextFormat();
//EXTERNAL TEXT LOADER
var externalReq:URLRequest = new URLRequest("ZD_What.txt");
var externalLoad:URLLoader = new URLLoader();
//LOAD TEXT
externalLoad.load(externalReq);
//ADD EVENT LISTENER
externalLoad.addEventListener(Event.COMPLETE, textReady);
//TEXT FORMAT
txtBody.font = "Arial";
txtBody.color = 0xFFFFFF;
txtBody.size = 10;
//TEXT BOX
txtWhat.width = 532;
txtWhat.border = true;
txtWhat.borderColor = 0xFFFFFF;
txtWhat.height = 180;
txtWhat.wordWrap = true;
txtWhat.x = 110;
txtWhat.y = 13;
txtWhat.setTextFormat(txtBody);
addChild(txtWhat);
function textReady(event:Event):void
{
txtWhat.text = event.target.data;
}
Text Field Formatting And Selection
Hello
I am trying to dynamicall generate text from an xml file. I want to know a good idea on how to make and then parse an xml node that will be displaying the text contents in Bullet point. See the sample below
Objectives:
. Our first objective
. Our second objective
. Our Third objective ... so on
This is one issue.
The other issue is because I am making a content managment System. SO I want users to change the text and send it to ASP.net script so that the xml content file is udated on server.
How would I allow user to edit the text in this case lets suppose objective text but still keep some special characters that determine the end of one point?
Thanks in advance
I hope I am making sense herel..
Form Field Text Formatting Help
hello guys and a happy new year
I have once again started tinkering about with another part of my site. the form fields for contact, postnew(forum), postMsg(siteinbox) I am trying to take away the basic formatting sys i have
ActionScript Code:
//Bold but
msgfield.text+=msg+" <b>type bold text here</b>"
Pretty much the same for italic and underline.
Now i have seen a form field somewhere that when you high-light the text and then press the B button and the text gets formatted.
I tried downloading a couple of the text editers from flashcomponents.net but i am still none the wiser.
Anyone no how i can do this
Cheers
Paul
Formatting A Dynamic Text Field
Hey USers, I am trying to format some dynamic textfields but the formatting is not taking place with my code. everthing is in place but the formatting is not working either. Also how can I embedd the font "Forgotten Futurist" into flash so all users on the web get this font when they are browseing the site?
Cheers!
ActionScript Code:
var totalNews = 3; //total number of news articles in session
var newX = 4; //newX position of title
var newY = 4; //newY Position of title
myArr = new Array(0000, 1111, 2222);
var formatObj = new TextFormat();
formatObj.size = 20;
formatObj.color = 0xE3159D;
formatObj.font = "Forgotten Futurist";
formatObj.selectable = false;
if(totalNews > 0) {
for(i; i < (totalNews); i++) {
//duplicates news title
this.attachMovie("news_title", "news_title"+i, i);
this["news_title" + i]._y+=25
this["news_title" +i].createTextField("title_txt" + i, i +1, 25,4,200,20);
this["news_title" +i]["title_txt" +i].setTextFormat(formatObj);
this["news_title" +i]["title_txt" +i].text = myArr[i];
this["news_title"+i]._y = newY;
this["news_title"+i]._x = newX;
if(i>=0){
newY +=25;
}
}
}
Formatting Text In Email Input Txt Field
hey there,
once again im feeling as useful as a chocolate teapot, cuz i dont get the point in formatting some input text correctly. here's the
situation:
i have an email-form on a website which allows the user to send an email to a certain adress ( obviously ). everything works out fine, but there r some characters like "ä", "ö" etc r not displayed correctly. im using php for the mail-script. can any1 tell me, what to do to get the characters displayed correctly?
as usual every help appreciated
[F8] Dynamic Text Field Formatting Lost
Greetings ... and firstly, yes, I did search the forums before I posted this question up.
I have a Dynamic text field that I update using a variable, but I have put in letter spacing of 2. As soon as I dump any thing into the variable (and the field updates) the letter spacing is dumped and the letters appear on top of each other. I developed the font my self but it's going to take ages to re-export the font with the right amount of space between the letters.
I know every one says use HTML formatting but I don't think there is a control for letter spacing.
The second issue I have is a small one. Another dynamic text field I'm dumping text into removes the trailing spaces.
Oh .... I'm trying to re-create a Sharp EL-506W calculator with it's dual line display for some one teaching kids to use it.
Thanks.
[F8] Input Text Field Without HTML Formatting?
Hi gang, got a problem that's likely extremely simple but is driving me round the bend.
I have an Input Text field. The var assigned to it is "newword". The user types in a new word, which is assigned to newword, then my movie runs off and does all it has to do with the word.
However, when I trace(newword), it's tossing on a bunch of HTML code around it that I don't want. So what should be "hello" becomes: "<TEXTFORMAT LEADING="2" Blah dee blah>hello<Bunch of other formatting></TEXTFORMAT>".
How do I get it to just input the text?
I'm in Flash 8, and the "Render text as HTML" button on the properties bar has no effect.
Thanks,
-k.
HTML Formatting Not Working In Text Field.
I have a progromatically created text field.
html set to true.
the basic formatting - such as <p>, <h1> etc, don't render.
Am I missing something?
var nWidth:Number = mcDisplayBackground._width;
var nHeight:Number = mcDisplayBackground._height;
var nX:Number = mcDisplayBackground._x;
var nY:Number = mcDisplayBackground._y;
var nInterval:Number;
this.createTextField("tContent", this.getNextHighestDepth(), nX,nY,nWidth,nHeight);
tContent.html = true;
tContent.multiline = true;
tContent.wordWrap = true;
tContent.condenseWhite = true;
var lvArticleContent:LoadVars = new LoadVars();
lvArticleContent.onData = function(sHTMLData:String):Void {
tContent.htmlText = sHTMLData;
};
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
cssStyles.onLoad = function():Void {
tContent.styleSheet = this;
lvArticleContent.load("flashContent.html");
};
cssStyles.load("presentation.css");
Text Field Forces Bullet Formatting?
I'm loading html text chunks from an xml document and displaying them in an HTML formatted input text field based on the user selecting an item in a list box.
See the fla & xml files at http://www.brianwpiper.com/bulletSticks.zip
and you can see the swf at http://www.brianwpiper.com/bulletSticks.html
...the third chunk has bullets, so if you select Chunk 1 or 2 you'll see they don't start with bullets, click Chunk 3 and then click back on Chunk 1 or 2 and you'll see they now have bullets?!
If you select a chunk that has bulleted text in the first paragraph and then select another chunk, it forces the bullets onto that chunk, even though there are no bullets defined in the xml?!
Is there a way I can fix this??
It only happens when the chunk begins with a bullet. You'll see Chunk 2 has bullets within the text, but it doesn't force the formatting.
I even tried adding a Reset button which clears the field & sets the html & bullets to false, but that didn't keep the bullets away...
I even tried:
Quote:
var my_fmt:TextFormat = new TextFormat();
my_fmt.bullet = false;
inTxt.setTextFormat(my_fmt);
inTxt.htmlText = "";
inTxt.html = false;
on the reset button, but no luck there either...
Thanks!!!
Display Formatting From Text File In A Dynamic Field
is this possible?
i read my news information from a file called news.txt... the unfortunate part is that i can not use any formatting what so ever
is there a way to display formatting from a text or html file using some codes or anything?
thanks in advamce
Adding Html Formatting To External Text Field
Hi, apologies if you read this post in my previous entry, i should have started it as a new topic..
I've got a dynamic textfield calling an external text file from the server OK, but I want to add a bit of formatting e.g. bolding the titles. I've read a few posts on this, but am getting a headache working out what I change in my code! Or do I change something in the external file itself?
The textfield is called load_txt (the var: my_lv)
The action applies to the layer is:
my_lv = new LoadVars();
my_lv.load("http://www.europahost.net/nrg/load_txt.txt");
my_lv.onLoad = function(success) {
if (success) {
load_txt.htmlText = this.load_txt;
trace("loaded");
} else {
trace("not loaded");
}
};
Thanks in adv
andy
Input Text Field- How To Prevent HTML Formatting
Hi
I am trying to create an input text field which does not insert HTML formatting to whatever the viewer types in it. For example, if the viewer puts the text "hello" into the text box, the value of the box should not be
<p align="left"><font face="Times" size="18" color="#000000" letterSpacing="0.000000" kerning="1">hello</font></p>
but just "hello"
I have unchecked that "allow html formatting" button on the properties bar
but it still inserts those tags. What am I doing wrong?
in the attached example, you should see the problem demonstrated - if you click on the button, it traces the value of the input text box. I would like that to be simply "hello" without all the html tags.
Thanks!
Dynamic Text Field Ignoring HTML Formatting
Hello,
I have a dynamic text field set to multiline and render as html, but when I assign any text to it which contains simple HTML formatting like <b>boo</b>, Flash Player 9 simply ignores any text between the tags. eg <b>boo</b> doesn't display at all !!!
The text field has both an instance and variable name and I get the same results from both.
If I trace the variable I can see the <b>boo</b> but I can't get it to display.
If I uncheck the render as html option, it displays <b>boo</b> ... obvioulsy unrendered.
I'm obviously missing something simple ... please put me out of my misery.
Thank you.
Form Field Styling (Input Text Formatting)
Is there a way to format multiple form fields (input text) at the same time? For instance, I have a form with 10 input text fields and I want all of them to have black borders and gray backgrounds. To do this, I've coded one as:
txtInput1.border = true;
txtInput1.borderColor = 0x000000;
txtInput1.background = true;
txtInput1.backgroundColor = 0xCCCCCC;
Is there a way for me to create a sort of "style" that I could apply all of these values to a text input easily, the way TextFormat can apply text styles?
Formatting A Text Field To Show Currency (euro)
Hey,
This is wrecking my head. I can't figure out how to format a text field so that it shows me currency in the european format, that is:
1.000.000,00€
I am adding up text field values, so the outcome is :
1000000.00
that's no goood.
Any help appreciated, sorry for my english.
Formatting The Bg/border Of Flash Input Text Field
Since there's an option in the panel for formatting the bg and/or border of the textfield in a form, I guess it's doable but I can't figure out how. Any tips? (I've seen in other sites where they have the bg of the field a different color or the field actually looks embedded in the page...)Thank you.
Html-formatting Of Dynamic Text Field With Embedded Font
If you're creating a htmlText field via the createTextField method, is there a way to get html formatting like <b></b> to show up if you are also embedding a font?
I'm guessing not, since you can only embed a single font in a TextFormat, and you would have to embed both italic and bold variants too to make it work. Is this true?
Maybe I'm better off creating a generic text field on the stage with both bold and italics embedded, and use the attachMovie method instead?
This is my code:
ActionScript Code:
myformat = new TextFormat();
myformat.font = "Akzidenz_Grotesk_BE_Light";
myformat.size = 20;
curr_image = curr_top.createTextField("largetext", 401, 242, 32, 682, 254);
curr_image.selectable = true;
curr_image.multiline = true;
curr_image.html = true;
curr_image.embedFonts = true;
curr_image.htmlText = "Hello <i>this</i> is a <b>text</b> field";
curr_image.setTextFormat(myformat);
Trouble With Y-axis Positioning / Formatting Dynamic Text Field
Hi,
Ok, here's what I've got. I have an input text field and then a submit button. The submit button places whatever text that the user enters into the input field into a dynamic text field. I then have three buttons that change the font in the dynamic field, and three more buttons that change the fontsize (using if statements).
My problem is that one of the fonts does not line up exactly as the others do on the y axis. It appears to jump down a few units when I change the font. Also, when I change the font size, using the buttons, they align to the top of the text box, appearing jump up. I've been trying all kinds of scripts, but theres always something that causes trouble.
I'm wanting the positions along the y axis for each font to appear to be even, which I have accomplished simply by defining the y-axis position for each font, on each button that changes the font. That works great. But when I change the font size to a smaller font, I want each size to still line up on the y-axis. And after I achieve this, the movie needs to be able to remember the positioning for when I go back to change the font, it will not jump back to where it was before.
Here's my script on one of the buttons that change the font:
on (release) {
myTxtFmt = new TextFormat();
myTxtFmt.font = "Franklin Gothic Medium";//Linkage name of the font in the library
_root.SignTextColor.setTextFormat(myTxtFmt);
_root.SignTextColor.setNewTextFormat(myTxtFmt);
_root.SignTextColor._y = 7.2;
gotoAndStop(1);
}
Here's my script on one of the buttons that change the font size:
on (release) {
myTxtFmt = new TextFormat();
if (myTxtFmt.font != "Franklin Gothic Medium") {
myTxtFmt.size = "57";
_root.SignTextColor.setTextFormat(myTxtFmt);
_root.SignTextColor.setNewTextFormat(myTxtFmt);
}
if (MyTxtFmt.font != "ATFAntique") {
myTxtFmt.size = "55";
_root.SignTextColor.setTextFormat(myTxtFmt);
_root.SignTextColor.setNewTextFormat(myTxtFmt);
}
if (myTxtFmt.font != "Hudson") {
myTxtFmt.size = "58";
_root.SignTextColor.setTextFormat(myTxtFmt);
_root.SignTextColor.setNewTextFormat(myTxtFmt);
}
gotoAndStop(1);
}
Can you help?
Thank you very much!
Auto Formatting Html Links With Color In Dynamic Text Field
formatting html links using cdata
I am parsng a xml document that has html along with text, I am bringing the xml into a dynamic text field. I can retrive the same data from cdata tags as well.
I get the links into my document ok but I need to color the links so user can tell they are links.
Know anyway to do this?
MAybe a function that will take your text, look for the hrefs and add the color thing in the text.
anyone devloped this or know of a workaround?
I unfortunatly cannot modify my xml
Example xml and .fla here:
http://lincart.com/xml_feed_samples.zip
Here is a srting prototype I found that might do what I need but I cannot figure out how to implement???
String.prototype.makeClickable = function(){
var tmp = this.split(" ");
for(var i = 0; i < tmp.length; i++){
if(tmp[i].indexOf("www.") != -1 && tmp[i].indexOf("http://") == -1){
tmp[i] = "<font color="#0000FF"><u><a href='http://"+tmp[i]+"' target='_blank'>"+tmp[i]+"</a></u></font>";
}else if(tmp[i].indexOf("http://") != -1 || tmp[i].indexOf("ftp://") != -1){
tmp[i] = "<font color="#0000FF"><u><a href='"+tmp[i]+"' target='_blank'>"+tmp[i]+"</a></u></font>";
} else if (tmp[i].indexOf("@") != -1 && tmp[i].charAt(0) != "@" && tmp[i].charAt(tmp[i].length-1) != "@") {
tmp[i] = "<font color="#0000FF"><u><a href='mailto:"+tmp[i]+"'>"+tmp[i]+"</a></u></font>";
}
}
return tmp.join(" ");
}
how would it apply to my code?
do I assign the tmp var to my var?
//frame 1 parse xml
function Article(id, news_item) {
this.id = id;
this.news_item = news_item;
}
function makeArray(success) {
var i, j, mainTag, id, news_item;
if (success) {
for (i=0; i<=moXML.childNodes.length; i++) {
if (this.childNodes[i].nodeValue == null && this.childNodes[i].nodeName == "idj_news_feed") {
mainTag = this.childNodes[i];
}
}
for (i=0; i<=mainTag.childNodes.length; i++) {
if (mainTag.childNodes[i].nodeName == "record") {
articleTag = mainTag.childNodes[i];
id = articleTag.attributes["id"];
for (j=0; j<articleTag.childNodes.length; j++) {
if (articleTag.childNodes[j].nodeName != null) {
if (articleTag.childNodes[j].nodeName == "news_item") {
news_item = articleTag.childNodes[j].firstChild.nodeValue;
}
}
}
thisArticle = new Article(id, news_item);
articles.push(thisArticle);
delete thisArticle;
}
}
_root.gotoAndStop("showArticles");
}
}
// articles is an array of Article objects
var articles = [];
// read xml and display when loaded
moXML = new XML();
moXML.ignoreWhite = true;
moXML.onLoad = makeArray;
moXML.load("demoNews.xml");
stop();
// frame label showArticles
news = "";
for (i=0; i<articles.length; i++) {
news += "<a href='" + articles[i].link + "'>" + articles[i].news_item + "</a><br>";
//news += " <font color='#cccccc'>(" + articles[i].source + ")</font><br>";
}
scroller.html = true;
scroller.htmlText = this.news;
stop();
thanks for the help I am still getting a grasp on coding.
Trying To Pass Text From Form Text Field To A Flash Dynamic Text Field
Hi, I was hoping someone might enlighten me as to how/if I can do this...
Currently I'm using javascript which works fine to pass text from textfield A to textfield B:
Code:
window.onload=function()
{
document.forms.form1.shirtText.value=document.forms.form1.KitGroupID_16_TextOption_38.value
}
Is there a way to pass the textfield A text to a dynamic text input (flash) as I'd like to use the font embedding flash offers. I can make it work when loading a value from a txt file but I'm not sure how to access the value identified above as KitGroupID_16_TextOption_38 and make it appear in a dynamic input box. Eventually I might want to have 3 font choices for the user but I'd like to just see if I can get this working properly first.
Your help/advice would be greatly appreciated,
-Scott
Loaded Text File Wont Show All Of The Text In Dynamic Text Field
When I load an external text file into flash and display the string in a dynamic text box, not all of the text will show in the text box; and using scroll button to scroll the text doesnt help.
The text that is in the text file is as follows, and as far as I can see there is no reason why all this text shouldnt show in the dynamic text field; by the way all my targets are correct, I know that for fact.
message=Code: Cheat:
BEEPSAGONER Deactivate the censor beeps
DRACULASTEABAGS 50 lives
DUTCHOVENS Frying pan mode
XFYHIJERPWAL IELWZS Debug mode
BOVRILBULLETHOLE Shoot all objects
EASY Easy mode
VERYEASY Very easy mode
SPUNKJOCKEY New death animation
SEXYMANN Birdy & Squirrel scene
Code: Unlock chapter:
PRINCEALBERT Barn Boys
CLAMPIRATE Bats Tower
ANCHOVYBAY Slopranos
MONKEYSCHIN Uga Buga
SPANIELSEARS Spooky
BEELZEBUBSBUM It's War
CHOCOLATESTARFISH The Heist
WELDERSBENCH All chapters and scenes
Code: Unlock Multiplayer character:
WELLYTOP Conker
EASTEREGGSRUS Neo Conker
BILLYMILLROUNDABOUT Gregg the Grim Reaper
CHINDITVICTORY Weasel Henchmen
EATBOX Cavemen
RUSTYSHERIFFSBADGE Sergeant and Tediz Leader
BEEFCURTAINS Zombies and Villagers
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
Getting A Text String Value From A Text Field And Duplicating It In Another Text Field
I'm trying to take the text from one text field and duplicate it in another.
I want to display the text that is in the text field _root.MC_Control.tab_title in another text field called _root,video_title.
I have tried this:
_root.video_title.text = _root.MC_Control.tab_title.text;
and this:
_root.video_title.text == _root.MC_Control.tab_title.text;
neither one seems work....am I missing something?
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.
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.
Load Text From A Text File Into A Dynamic Text Field
I'm trying to load text from a text file into a dynamic text field. The text field is on the "blog" page of the website. When I test my movie, the first time I go to the blog page, the text from the external text file (AND the CSS styles) show up fine. But when I click from the blog page to go to the "profit calculator" or "contact" pages and THEN click to go BACK to the blog page, the blog page animates back in, and right as the animation ends, the text on the blog page suddenly disappears and won't come back. PLEASE help me figure this out!
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?
|