ActionScript 3.0 :: Giving Different ContainerControllers Different Text Colors
Oct 6, 2010
I'm struggling with setting custom formatting properties on different ContainerControllers assigned to a single TextFlow instance. I can assign different columnCount properties and those display as desired, but other properties such as color seem to be ignored. I have tried this syntax:
In both cases, the columnCount is set correctly, but the color is ignored. Is it possible to affect the color of the displayed text? That would seem to be one of the primary advantages of TLF text?
I'm trying to use a dynamic text field to pull in html text that contains a bulleted list. Easy enough, that works. But the bullets dont take on the color assigned to the field. I've tried putting it in the html text and also using NewTextFormat and neither work. Can someone help me. This should be a simple fix, but I can't find it... I just want my text and bullets to both be white.
Simple code below. Using html text inside the flash document and having a dynamic field on the screen named txt. Code should turn text and bullets green, but it doesn't work, only text turns green
this.txt.html = true; var my_fmt:TextFormat = new TextFormat();my_fmt.color = 0x00FF00; // hex value for green this.txt.htmlText = "<P> This is the first paragraph</P><BR><UL><LI>Bullet 1</LI><LI><BR>Bullet 2</LI><LI><BR>Bullet 3</LI><LI><BR>Bullet 4</LI><LI><BR>Bullet 5</LI></UL>";this.txt.setTextFormat(my_fmt);
How do I alternate text colors in a dynamic text field I tried to use CSS but it changes all the text to the same color i want each line to be a seperate color.
So I have a method that takes in a String and then is suppose to set the dynamic textbox on a button to said String.
public function setText(caption:String) { this.btext.text = caption; }
I really don't understand why this method is producing a 1119 error. Access of a possibly undefined property btext through a reference with static type Button.as The instance name of the Dynamic Textbox is btext and I have tried deleting the textbox and making a new one however this still produces a 1119 error. I also read on another stack question that trying this['btext'].text = caption; which gave me plenty of runtime errors.
I get the following warning when I run my application:
warning: incompatible embedded font 'Arial' specified for spark.components::Label (Label104).This component requires that the embedded font be declared with embedAsCff=true.
The application I am working on is a mix of Halo and Sparks components as I am migrating it to Flex 4. The text that is showing in the text fields is defaulting the systems serif font. There are a few problems with this warning.
1) I am not embedding any fonts in the application. I am not even assigning the Arial font to any of the components.
2) If I check the "Use Flash Text Engine in MX components", then all the text fields in the app throw the warning. Not just the sparks text fields.
Why does flex 4 think that I am using an embedded font with the sparks components? Is there any way to get around this warning and have the text fields use a non embedded font?
I wonder what kind of class(es) I should use to accomplish this task. I have two predefined colors, 0xFF0000 and 0x00FF00 (red and green), and I would like to set a number of gradiants of colors between these two colors. [code]This generates a random color, but I don't want to generate just any random one. Does anyone know what kind of color class I should use to accomplish my task objective?
I'm building a project for a gaming website and i have an interesting dilemma. How do i make the font color change based on the data loaded from the external .txt file.
Example:
In text files i could have... yes yes yes no no maybe yes no. If the text says yes i would like for the font to change to green, if no to red, or maybe to orange/yellowish.
So basically if i went in and changed the No to a Yes on a .txt file, the next time i viewed that flash section the yes text would be in green instead of the default set by the flash core itself.
I hope i am making sense. I don't even know how to go about starting and i stared at the actionscript list for awhile to no avail.
I tried using several text fields to show headlines in different colors, but when i post them online they get all messed up. Is there a way to switch between 2 colors within a single text field?
I am needing to have the three distinct areas to be different colors of text. Can I do it in this line only? These elemnts are being pulled in from the first part of my file and I want them all the same unitl I pull the the info into "feedback.htmlText".
when i run this code.. all is good and everything is read from the file trees.txt
var myLoader:URLLoader = new URLLoader() myLoader.dataFormat = URLLoaderDataFormat.VARIABLES myLoader.load(new URLRequest("trees.txt")) myLoader.addEventListener(Event.COMPLETE, onDataLoad)
[code]...
now what i am trying to do, and i am almost certain i am going the wrong way with this, is to add on rollover a button that corrosponds to the text the text will change color from black to red. meaning... if i rollover button_0 the text of tcname_0 with change to red , and if i rollover button_1 text in tcname_1 would change.. and so on. so here is what i did:
var myLoader:URLLoader = new URLLoader() myLoader.dataFormat = URLLoaderDataFormat.VARIABLES myLoader.load(new URLRequest("trees.txt"))
[code]...
2- if the loop works and doesnt break, i still have a problem of how to exactly pass the name of the text field that should be changed. right now i am hard coding it as tcname_2 to see if this even works but i would like it to somehow pass the button_x (x being the number) and use that x to change the corrosponding text i.e (tcname_x) .. is this even doable?
how I can manage to give single words inside a DataGrid-CellRenderer a different color than defined by the TextFormat for that CellRenderer? It's not how to get these single words, it's how to use more than one color inside one cell...
I am working on project as under:on first step ( screen) there are 2 text fieldsuser inserts text in a field and on the second text field same text appear as he typeshe clicks on a button to go to step 2On the second step he has the written text from previous screen and buttons to change font, colors and position of the text box.
on first step (screen) there are 2 text fields user inserts text in a field and on the second text field same text appear as he types. he clicks on a button to go to step 2 On the second step he has the written text from previous screen and buttons to change font, colors and position of the text box.
I am colorblind.I need to change either the color of the background or the color of the text on the layers section on the Timeline.I simply cannot read/see what is currently showing.It is a very light blue background with white text and white dots for seeing, locking, or setting the outline color.I need to either change the text color and dots to black so I can see them, or try to change the background color to a dark blue so I can read the white text.Changing the text color would really be my preference. Adobe hasn't been very concerned about colorblindness when developing these products. I can barely make out all the light grey/grey/dark grey/grey stuff.
Does a Flash CMS site give you the best of both worlds? I want asite but I need it to be searchable. Does a Flash CMS site rank well enough to do the job? If it does not rank well, is it because the Flash portions would get no SEO but the HTML portions would?OR is it something inherently missing in the software that will keep it low on the rankings, no matter what the ratio of Flash versus HTML there is on that site? Would an HTML site with Flash plugins hurt my rankings much? Could I solve my problem best by having an HTML based landing page that gives access to 2 sites, one strictly HTML and one either Flash or Flash CMS based? Assuming the landing page and HTML portions are optimized properly, is the content that is on the HTML landing page and HTML site going to give me good SEO results, even though one of the options to choose is a Flash site?
stage.addEventListener (Event.ENTER_FRAME, lala); function lala (event:Event) { var object = new object_mc;
[code]...
How do I correctly declare a variable for each duplicate? The final line doesn't work in AS3 but it does in AS2. I want the same variable for each duplicate that I can individually change. Also how do I make a function for each duplicate? In AS2 I can do it by:
PHP Code:
object = duplicateMovieClip(........); object.onEnterFrame = function () { ......... }
[code]i know about arrays and the code above isn't what i got its just a way to try and explain it a bit better.I would like to know for a TD game i am trying to make
I'm running a function equivalent to onEnterFrame. The function is checking variable values to see where on the playhead to play a particular video. The problem I'm running into is where the first conditional is passing a value of 2 to seqTotal and checking for the value at the same time. The conditional for seqTotal being equal 2 runs before it should. How can I delay giving a value to a variable so this doesn't happen?