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




TextArea Formatting



Apologies if this has been answered but my best attempts at googling have failed me, as have my books, adobe documentation, and a forum search! So again, sorry if this has been answered in detail.Basically, I have a TextArea component with an instance name of inputText to start. I have 2 colorpickers on my stage, one will control the inputText font color, the other will control the inputText background color. At least, those are my hopes.So to start, I wanted to just get my color picker's change event to change all the text in TextArea to what was selected. I have 5 frames, the first frame will be my preloader (will be preloading a giant list of fonts later) and on frame 5 the following code appears:
Code:
stop();import fl.controls.ColorPicker;import fl.events.ColorPickerEvent;fontColor.addEventListener(ColorPickerEvent.CHANGE,changeFontColor);function changeFontColor(event:ColorPickerEvent):void { var myCP:ColorPicker = event.currentTarget as ColorPicker; var format:TextFormat = new TextFormat(); var ta:TextFormat = new TextFormat(); ta.color = "0x"+myCP.hexValue; inputText.setTextFormat(ta);}
I get no errors when I check it, however, when I run the movie I get the following error: "1061: Call to a possibly undefined method setTextFormat through a reference with static type fl.controls:TextArea."What am I doing wrong? I've struggled with this problem for a full day now, so I'm turning to you for what I'm sure is an easy explanation as I learn AC3. thanks!



KirupaForum > Flash > ActionScript 3.0
Posted on: 08-14-2008, 08:20 PM


View Complete Forum Thread with Replies

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

TextArea Formatting
Can anyone PLEAAAASE tell me how to format a textArea in 2004 pro??

I'm pulling text in through an XML doc and the textArea is formatted for HTML text. What I really want to do is, create a different default color for the text besides black. So if I don't define the text Color in a tag in my xml, it will just always be that default color. Or if anyone knows how to change the textAreas default color with a stylesheet. Anyone??

I've tried myTextArea.setStyle("color", 0xFFFFFF);
and it only works for non-html text

thanks,

Textarea Formatting.
How to change font, font size, collor and other stuffs on text area(the component)

Formatting TEXTAREA
I'm having trouble getting some TEXTAREA formatting to take.
The goal is to get the text to align right, but its not working

// format textarea component
import mx.styles.CSSStyleDeclaration;
_global.styles.TextArea = new CSSStyleDeclaration();
_global.styles.TextArea.setStyle("disabledColor", 0xFFBBBB);
var caption_ta:mx.controls.TextArea;
//
caption_ta.html = true;
caption_ta.setStyle( "fontFamily", "Gill Sans" );
caption_ta.setStyle( "fontSize", "14" );
caption_ta.setStyle( "embedFonts", "true" );
caption_ta.setStyle( "backgroundColor", "#999999" );
caption_ta.setStyle( "borderStyle", "none" );
caption_ta.setStyle( "textAlign", "right" );
caption_ta.setEnabled(false);
caption_ta.vScrollPolicy = "off";
//end format textarea component

Textarea Formatting And Scrolling
i have a question about text...
so i wanted to make a textarea that could scroll, so i used the text tool, made it into dynamic text and put a scrollbar next to it. the problem with dynamic text is that it seems like if i want to just format one word, the whole text area gets formatted. like if i just want one word in a sentence to be bold, i can't do that because the whole sentence bolds.
is there anyway for me to be able to format words individually like when the textarea is static text and still have it scroll??
thanks!

TextArea Not Loading Formatting
UPDATE : Problem resolved--seems to have been in the .txt files. Thanks for looking

I'm new to loading files in to flash...trying to load in two text files, one is a css formatting and the other is the content for a text area. What I have here doesn't seem to be loading in either file..they are in the same path as the .fla so I don't think it's a problem with finding the file
Could someone with more experience please take a look at this and tell me why it isn't working? Thanks very much!

ps-box.ta is a textArea inside of the box symbol.


ActionScript Code:
taStyle = new TextField.StyleSheet();
taStyle.load("textAreaFormatting.css");
box.ta.styleSheet = taStyle;

// Specify ta can hold html
box.ta.html = true;
// Specify ta to wrap text
box.ta.wordWrap = true;
// Specify ta to have a scrollbar
box.ta.multiline = true;

loadtextContent = new LoadVars();
// Load the text file into my movie
loadtextContent.load("newzContent.txt");
// Start a new function to load the text file
loadtextContent.onLoad = function(success) {
    if (success) {
        // loads the file into mytextbox
        box.ta.text = this.mytext;
        trace(this.mytext);
    }
}

Formatting Textarea Text With Css
i followed the tutorial and everything works fine

however, i am having trouble controlling list item with css

maybe my css code is wrong?

LI {list-style-type:circle}
LI LI {list-style-type:disc}
LI LI LI {list-style-type:square}

when i put that in flash.css i get the ERROR LOADING STYLESHEET message in my textarea

TextArea And Text Formatting
Hello all,

I was wondering if anyone was able to help me.
I've got an action set to pull some information up on screen from a file.

I'd like to find away to get the text to be White, Arial, Bold, and size 15... but i have no idea how! i've been trying to figure it out for over a week now and no luck at all.

Is anyone able to help?

Below is my action.
This is using ActionScript 3 in Flash CS3

Code:

Code:
var externalReq:URLRequest = new URLRequest("SYM.txt");
var externalLoad:URLLoader = new URLLoader();

externalLoad.load(externalReq);
externalLoad.addEventListener(Event.COMPLETE, textReady);

function textReady(event:Event):void {
box1.text = event.target.data;
box1.setStyle("upSkin",Sprite);}
I look forward to your replies.


Many Thanks, Irianna

Textarea Formatting - Color And Html
This is in MX 2004:

I've been baffled all day on this one. I'm trying to set up a textarea in a flash movie that will show content that is loaded from an external file. This external file should be able to include paragraph breaks, links, etc.

I've set up my textarea and to test, assigned this code to it:

main.scrolltext.html = true;
main.scrolltext.depthChild0._alpha = 0; //makes textarea transparent;
main.scrolltext.color = 0xFFFFFF;
main.scrolltext.fontSize = 14;
main.scrolltext.fontFamily = "_sans";
main.scrolltext.text = "test test < br >test";

With the above code, i'm seeing the third "test" wrap down to the next line, so the html code is being obeyed - but the color, size, and font specifications are ignored.

If I modify the first line to read:
main.scrolltext.html = false;
The color, size, and font are right, but the < br > prints out as is.

Also, I've noticed that paragraph tags don't seem to work. Why wouldn't they? I know I've used them in MX.

Thanks in advance.

Formatting Text In Textarea Component
Is it possible to format the text of a TextArea component using TextFormat?

Textarea Component (Formatting Text)
Accoring to Ultrashock:

ActionScript Code:
content0.backgroundColor = 0x5AADD2;content0.borderStyle = "solid";content0.borderColor = 0x5AADD2;content0.fontFamily = "Verdana"; // doesnt workcontent0.fontSize = "10"; // doesnt workcontent0.fontWeight = "bold"; //doesnt work  


All of that should work. As you can see I can't set the fontFamily, fontSize, and fontWeight of my text. The ones that aren't commented work fine, but I can't find a good link or tutorial on this subject.

I thought Macromedia had something on this, can't seem to find it.

Textarea Component (Formatting Text)
Accoring to Ultrashock:

ActionScript Code:
content0.backgroundColor = 0x5AADD2;content0.borderStyle = "solid";content0.borderColor = 0x5AADD2;content0.fontFamily = "Verdana"; // doesnt workcontent0.fontSize = "10"; // doesnt workcontent0.fontWeight = "bold"; //doesnt work  


All of that should work. As you can see I can't set the fontFamily, fontSize, and fontWeight of my text. The ones that aren't commented work fine, but I can't find a good link or tutorial on this subject.

I thought Macromedia had something on this, can't seem to find it.

Formatting Tags Appearing In TextArea Component
I'm having an issue with TextFormat tags that are appearing in textfields. Here's an overview of what I'm doing:
Basically, I'm trying to grab the text from a textArea component: (myText = myTextArea.text")

Because I want to retain formatting, I have the textArea set to be html.
Thus, myText becomes the text you see below

So the myText data is then stored in XML, but later when I try to access it, it fills that same textArea component with the literal code rather than the formatted text. How do I take that TextFormat string and convert it back to it's original form? I've tried myTextArea.htmlText but I guess that isn't it. Thanks for the help!

Thanks!







Attach Code

<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="_sans" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0"><B>Hello World!</B> but this ain&apos;t bold!</FONT></P></TEXTFORMAT>

Help With TextArea Component Calling Javascript From Link In TextArea
Can anyone help me?
I have a TextArea Component that gets populated from a XML. I have the text with links and I want to be able to click on the link and call my javascript on my page. Can I do this? of what will I need to do to accomplish this. if you can provide an example that would be great.
Thanks in advanced

BG Of TextArea In MX Pro
Hi,
does anyone know how to rip out the Back ground and borders of a text area...but still keep the scroller alive??

thanks,
morgan

TextArea
DOES ANYONE know ANYTHING about the new TextArea in MX Pro??

I love the scroller on it...but CAN'T turn the friggin background OFF!! Anyone??

Anyone??

Anyone??

Beuller??

Will Some One Please Help Me With The TextArea
What do i have to do to get my textarea box to load a MC named "hometext"

Can the text area load Movie clips. How else are you suposed to enter text? There has to be an easier way.

All i need is a text box that is scrollable to display on my homepage. no pics, just text.

And also how come my scroll pane when i try that just shows up as a box with no text when i have the right instance name loaded.

Please help i am pulling out hair over here.

John

TextArea
So I just got Flash MX 2004 Professional... I was starting to mess around with the added components. I wanted to use the TextArea box in one of my sites that I used the ScrollBar for... So when I open up a new document and just move over the TextArea and play the movie I can see the text box if I put something in the text I can also see that. So I get all excited and try to do the exact same thing in my customers site and nothing! You can even see the textarea. Argh! Has anyone ever come across this?

TextArea
This is driving me nuts, never really worked with components before so I was hoping someone could help me out. How do I target an external .txt file to be displayed in a TextArea component?

Any good tutorials on how to modify and use components?

Textarea And Xml
I'm using a text document saved as an XML file to import text into my textarea, but it's not reading HTML code too easily, sometimes it does, sometimes it doesn't...could I not use an HTML document and import it into the textarea?

Swf Into TextArea
Is it possible to load a swf into the textarea
and how

:-)

Textarea And Xml
i have a text area and the action script


Code:
myText.html = true;
myText.wordWrap = true;
myText.multiline = true;
myText.label.condenseWhite=true;

news = new XML();
news.ignoreWhite = true;
news.load("news.xml");
news.onLoad = function(success)
{
if(success)
{
myText.text = news;
}
}
but when i publish it and view it just with the flash player, or explorer, when i move the scroll bar it highlights everything in the text area and wont unhighlight

my xml file is

[HTML]<news>
<p>December 5th</p>
<p>*************************************</p>
<p>Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah and so on till it starts to scroll..</p>

</news>
[/HTML]

Add TextArea With AS
I want to add TextArea component with AS on the stage.
How can I do it?

Thanks

TextArea Help
I'm trying to control the background color of the TextArea - either a color which I set or make it transparent.
I could use some direction - here is what I'm experimenting with now:


Code:
package
{
import flash.display.*;
import flash.text.*;
import fl.controls.*;

public class OpaqueTest extends Sprite
{
public function OpaqueTest ()
{
var text_fp:TextArea;
text_fp = new TextArea ();
addChild (text_fp);

text_fp.htmlText = "<b>Hello World</b>";
text_fp.width = 100;
text_fp.height = 100;
text_fp.x = 100;
text_fp.y = 100;
//text_fp.visible = false;
text_fp.opaqueBackground = 0x00ff00;
//text_fp.textField.background = false;
}
}
}
Thanks

Using CSS With TextArea
Hi there,

I am wondering if I can use external CSS with TextArea Component.
I succeed to apply CSS with Textfield Object, but I can't use CSS with TextArea component. The reason I want to use TextArea component is, it can create scrollbar automatically.

If somebody know how to solve this proble, please let me know!

Thanks,

TextArea Help
Hi all i am doing a chat using flash AS3 (a rather simple one) inserting and reading from database . im using textArea to display the message read from the database . Problem is how can i display a new row for show instead of setting the text like (instancename.text = "xxxX")

so a simple one how to make sure that the newly read message can be displayed into a NEW row in a textArea...?

any help will be greatly appreciated . thank you xD


arhhh i solved it xD using :

var asd : String = chatOutPut_txt.text;
chatOutPut_txt.text = asd + "
" + e.data.toString();

CSS In A TextArea
has anyone been successful in getting font-size in css file to affect text in a textArea in MX 2004 pro??

I get the CSS in...and I can apply it to a textField....But I can't get it to apply to a textArea.

thoughts??

thanks

Xml And Textarea
Hi,
Im loading xml into a text area and then loading the .swf with the text area into the main .swf. I turned off the border and the background of the textarea and everything in the .swf where the text area actually exists is fine. But when I load the text area .swf into the main .swf and the xml text shows up, when i select it this funny green border appears around the text area. If i move my mouse off the text area and click, the border dissapears, but this does not happen in the .swf where the text area originally is created.

TextArea Help Please...
Hey guys,

I'm hoping someone can help me. I've been trying to figure this out for some time now and am finally giving up and begging for help! I've tried searching this all over the place, but with no luck. My problem is pretty simple, I just can't seem to make it work.

I have a textarea that loads into a movieclip. The textarea has a border I need to get rid of. Also, I need to know how to set the background color of the textarea or at least make it transparent. I've found several different ways to do this, but none of them will work. When I try to put the actionscript in myself, I get an error
saying an OnClipEvent handler is needed. I'm not sure what to do here. Can someone post the exact script I need to make this work? I've seen TextArea.border_mc._visible = "false";,
but I don't know what goes before this! The same with TextArea.setStyle("backgroundColor", "#ffffcc"); (I may have gotten these two wrong just now, I'm doing it off the top of my head, but I had cut and pasted the code directly into Flash from where I had found it!) I've tried substituting my instance name for textarea, but that didn't work either.

Please help, I'm lost!

Textarea And TAB Key
Hello,

Does anyone know of a way to make the TAB key function as it would in a text editor instead of as a navigation control in a flash movie?

I have a V2 textarea component I would like to act as an HTML code editing tool. Any time someone goes to tab in their code for cosmetic reasons, it jumps to the next tabbable component.

Things I've tried:

1) Making the textarea the only tabbable component using tabEnabled = true / tabEnabled = false on all components; as well as setting the tabindex on the textarea to 1 while all others are blank (almost works -- but the textarea loses focus and you can't detect where the carat was)

2) Catching the keydown event using Key.TAB (almost works -- again, the textarea loses focus and you no longer know where to put the TAB)

Any suggestions / solutions would be greatly appreciated.

- Regards

Img In A Textarea
hallo people

i'm in a trouble with displaying images in my texarea. i mean that i can show the image but it does not appears in the same line on my text, it appears in the next line.

how can i resolve this problem

thanks

TextArea
in Flash's help it says to use a TextArea you need to import fl.controls.TextArea but when I do, it says 1172: Definition fl.controls:TextArea could not be found.

TextArea CSS
Hi

I am trying to add CSS to a TextArea component in AS3. I know this can't be done easily with myTextarea.styleSheet so was wondering what the best way is? I've read articles about overriding the default draw function but most didn't have clear instructions on how to implement them.

My TextArea is dynamically added.

Cheers

TextArea Help Please...
Hey guys,

I'm hoping someone can help me. I've been trying to figure this out for some time now and am finally giving up and begging for help! I've tried searching this all over the place, but with no luck. My problem is pretty simple, I just can't seem to make it work.

I have a textarea that loads into a movieclip. The textarea has a border I need to get rid of. Also, I need to know how to set the background color of the textarea or at least make it transparent. I've found several different ways to do this, but none of them will work. When I try to put the actionscript in myself, I get an error
saying an OnClipEvent handler is needed. I'm not sure what to do here. Can someone post the exact script I need to make this work? I've seen TextArea.border_mc._visible = "false";,
but I don't know what goes before this! The same with TextArea.setStyle("backgroundColor", "#ffffcc"); (I may have gotten these two wrong just now, I'm doing it off the top of my head, but I had cut and pasted the code directly into Flash from where I had found it!) I've tried substituting my instance name for textarea, but that didn't work either.

Please help, I'm lost!

Textarea And TAB Key
Hello,

Does anyone know of a way to make the TAB key function as it would in a text editor instead of as a navigation control in a flash movie?

I have a V2 textarea component I would like to act as an HTML code editing tool. Any time someone goes to tab in their code for cosmetic reasons, it jumps to the next tabbable component.

Things I've tried:

1) Making the textarea the only tabbable component using tabEnabled = true / tabEnabled = false on all components; as well as setting the tabindex on the textarea to 1 while all others are blank (almost works -- but the textarea loses focus and you can't detect where the carat was)

2) Catching the keydown event using Key.TAB (almost works -- again, the textarea loses focus and you no longer know where to put the TAB)

Any suggestions / solutions would be greatly appreciated.

- Regards

Help With TextArea
Ok, so I've read up on the TextArea class in Livedocs, and i've been looking at XML explanations and their implementation into Flash for about a week. I've tried this EXACT code on another Flash document, except on the main stage instead of embedded inside of a separate movie clip, and it worked perfectly.

Can anyone explain why the text won't display in the TextArea? Does it have something to do with it being inside of a movieclip and that being placed on the Main Stage?

(By the way, proxy.xml is just a copy of the xml produced by my CFM proxy for easier usage, in case you were wondering. :wink: )

Here's the code:

Code:

var blogtext:mx.controls.TextArea;
blogtext.html = true;
blogtext.embedFonts = false;
var blog_xml:XML = new XML();
blog_xml.ignoreWhite = true;
blog_xml.onLoad = function(success){
   if (success) showblog(this);
   else {
      blogtext.text="The blog failed to load";
      trace("The blog failed to load.")
   }
}
blog_xml.load("proxy.xml")

function showblog(blog_xml){
      var blog = blog_xml.firstChild.firstChild.childNodes;
      for(var i=0; i<blog.length; i++){
      if(blog[i].nodeName == "item"){
         var blogs = blog[i];
         var titles:Array = blogs.firstChild.firstChild.nodeValue;
         var links:Array = blogs.childNodes[1].firstChild.nodeValue;
         var desc:Array = blogs.childNodes[2].firstChild.nodeValue;
         blogtext.text += "<headline><a href='"+
             links+"' target='_blank'>"+titles+
             "</a></headline><br /><br />"+
              desc+"<br /><br />";      
      }
   }
}

Dynamic Textarea
I everybody

i'm working on a dynamic textbox in Flash 5 and i load
properly the text. i'v created a button to enable scrolling

on (rollOver){
toto.scroll = toto.scroll+1
}

But in order to scroll several times you have to move your mouve several times on it.

I can't figure out how to tell flash that, if the mouse stays on the button, then continue scrolling, it would be
smoother for the user.

Thanks alot for your help

How Do I Edit A Textarea
I would like to just tint all of the halo's themes buttons and such a bit for my site, in essence skinning them. What would be the best way to do this. I've messed around a bit with the theme thing but not having much luck there.

My also is there anyway to have a dynamic textarea that will scroll if needed but have a non white background? If so how?

Thanks

Firehawk

TextArea...what The Heck?
Is it just me or is this new textArea component difficult to use? Does anyone know how to load a simple XML file into a textArea component and have it scroll??

TextArea Not Showing Up
I have a textarea on a frame that is displaying some HTML formatted text (that I typed in). It shows up fine in flash, yet when I publish it, there is nothing there (i.e. there is no box, or text).

TextArea Component
I was able to disable the borders of the textArea component using the
following action script

textArea.setStyle("borderStyle", "none");

But this created a new problem. Now when I select the text or hi the
scroll bar I get agreen "glow" or highlite where the borders would be.

Anybody have any suggestions


...may you see that on http://www.agenciax.com/clientes/lima_netto/ , when this load click on "escritorio" button on top menu in portuguese version.

Textarea Component Help
is it possible to make the background transparent?

TextArea Component
I have a dynamic textArea component. When I load new text into it, the scrollbar stays where-ever it was last positioned - is there a way to make it return to the top everytime? Does it ususally return to the top for everyone else?

Thanks
Jessica

TextArea Problems
Posted this the other day but nobody seemed to have any solutions so I'll try again. I have been setting up my TextArea, and have this:

myText.setStyle("backgroundColor","0x996633");
myText.setStyle("fontFamily","Monotype Corsiva");

Background colour changes fine, but I have been struggling with changing the font for days now. I don't know whether this is the wrong way of doing it, or that it just doesn't recognise "Monotype Corsiva."

Help appreciated.

A TextArea With TextFields ?
is it possible to first create a textArea (which has automatic scrolling), then send textfields via ActionScript?

i am asking it this way, cuz i will populate the textFields with data as they are created dynamically with ActionScript.

i am looking at the following class definition, but i don't know if i can do what i want to do.

can anyone input there 2 cents worth? i have included the class definition below:


Code:
UIObject.createObject()
Availability
Flash Player 6 (6.0 79.0).

Edition
Flash MX 2004.

Usage
componentInstance.createObject(linkageName, instanceName, depth, initObject)

Parameters
linkageName A string indicating the linkage identifier of a symbol in the library.

instanceName A string indicating the instance name of the new instance.

depth A number indicating the depth of the new instance.

initObject An object containing initialization properties for the new instance.

Returns
A UIObject object that is an instance of the symbol.

Description
Method; creates a subobject on an object. This method is generally used only by component developers or advanced developers.

Example
The following example creates a CheckBox instance on the form object:

form.createObject("CheckBox", "sym1", 0);

thx
Hector

Textarea Component
Hi

I have a movie that contains a textarea component. I am loadind in text from a database via php.

If I run the movie on its own it works perfect. But if I load it into an empty movie clip or a level the scroll bar goes erratic and for some reason when you click on the scroll bar the text inside gets selected.

I have tried to use a plain textbox but cannot get the text formatted using html as with the textarea, code below.

var lv = new LoadVars();
lv.onLoad = function(ok) {
if (ok) {
var i = 0;
while (this["id" + i] != undefined) {
noticeboard_txt.text +="<br><br><br><b><u>"+this["titles"+i]+"</u><br><br></b>" +this["news"+i]+"<br>" +"<b>"+this["author"+i]+"<br>"+this["date"+i];

i++
}
}
}
lv.load("noticeboard.php");
// Make background color transparent
noticeboard_txt.depthChild0._alpha=0

Thanks for any help.

Loadmovie And Textarea
hello,

I built a movie clip (biography.swf) with a dynamic text area, on frame 1 there's this action:

_root.textArea = loadVariablesNum("fileText.txt", 0,"POST");

when I test this movie everything goes well.

Then I built main movie (main.swf), which has a movie clip target (its instance name is target) and a button which should load biography.swf in order to show what is written on fileText.txt

this is the actionscript code I wrote:

on(release)
{
loadMovie("biography.swf",_root.target);
}

when I check main.swf and I click, the movie biography.swf is loaded but the textArea is empty.

how have I to load textFile.txt?

thanks a lot

TextArea Properties
Is it possible to change the background colour of a TextArea component? If so it would save me some time in re-inventing some of its features. I'm looking to import an html file into flash, as well as use a css sheet.

Thanks in advance

From ASP To Flash Textarea
I have search around here a little and find someone that have almost same problem that I have and have help from other.

I have try but never get that too work :-(

I have a flash.
Inside the flash I have a textarea (txtread) and a textinput (txtwrite).
I even have a button (cmdsend)

I have a script that send text from txtwrite to a ASP page that go to a database.


PHP Code:



cmdsend.onRelease = function () {
l=new LoadVars();
l.z = txtwrite.text;

l.sendAndLoad("test.asp", l, "POST");
}




That I like my flash to do is this.
When a person press the button cmdsend the flash send txtwrite to ASP and ASP go to a database. (that work)
and same time I like the textarea txtread update from the database through ASP page.
I even whant my textarea to update every 3 sec and pick information from the ASP page and the database


I have one the ASP page the text

PHP Code:



txtread=hello every body




and I have even try

PHP Code:



&txtread=hello every body




I use Flash 2004 MX and Actionscript 2.0

Can someone help me plz

TextArea Component Help
Don't know how to insert line break in 'text' field of 'Parameters'.

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