Flash :: DataGrid-CellRenderer: Multiple Colors For Text?
Nov 3, 2009
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 have a datagrid whose data keeps updating quite frequently.On every update, I need to change the cell color of only those cells whose data has changed.That too, if the updated value is less than the older value then the cell color should change to RED else, GREEN.
I have tried using labelFunction, cellrenderer, etc. But to no avail.By no means, I am able to access the present data in the cells to compare it with the new data.I have added the sample classes in the attachment. To get them to work, just create an fla with a DataGrid & a Button components in its library & mention 'del' as its document class.Just run the fla & click on the two buttons on stage to see the values in the price column changing.
I am attempting to combine two AS files that are acting as cellRenderers individually but not simultaneously for cells in a datagrid in a Flash document I have created. The first styles the cells to have alternating row colors and the second allows for non-text content to be rendered. The issue is whenever I attempt to combine them the document reports errors with "super" and "override" among others.
which I can't seem to solve. I'm using a cellRenderer to display icons in a dataGrid. All works fine until I type in the command myDg.hScrollPolicy = "auto". Once I issue that command, the icons stop displaying. If I remove that line, all works well once more.
I need to put a combobox in a column of a datagrid. The user just need to select a value from the existing combox items.I know I need to use a custom cellrenderer. Please see my current attempt below.This attempt successfully inserts a combobox into the datagrid, BUT without any data in the combobox. In fact, when I click on the combobox in the datagrid, it is the same as a normal combobox on the stage without a dataProvider. In other words, it doesn't even open.Thus, I need to know how to modify my cellrenderer to correctly add the data to the combo and accept changes made by the user when selecting a value from the combobox.[code]
The following code is the cell renderer for for a ComboBox in a DataGridColumn. It works fine when setting the comboBox's data in the constructor. There's a problem using the red code below. If the DataGrid row is not already selected the dropdown list appears but is empty.Any ideas? If the row is not already selected, the selectedItem is being set causing a STATE invalidation after the list a created. I'm not sure how to prevent this.
Not to certain how many people may need this script, but lo and behold I had need of it for my project. So, here's my script on how to add a movie clip to a Datagrid Cell via CellRenderer1) Create an Actionscript file (*.as) and call it IconCellRenderer2) Put the following code inside that file:
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 have a datagrid. It is populated dynamically by an XML file. I need to be able to set each row's text color seperately. For example, if my variable "type" is "urgent", it would be a red text color.
I've spent almost 2 hours trying to figure this out. I've tried setStyle, setRendererStyle, setTextFormat and many more and dozens of combinations. I know its simple cause I think I've done it before.
Let's say a user can pick fifty different hat colors and styles to put on an avatar. The avatar can move his head around, so we'd need the same types of movements in the symbol for when that happens. Additionally, it gets which hat should be on the 'avatar' from a database. The problem is that we can't just make 50 different frames with a different hat on each. And each hat symbol will have the same movements, it'll just be different styles, colors and sizes. So how can I make one variable that is the HAT, that way we can just put the appropriate hat symbol into the variable and always be able to call Hat.gotoAndplay('tip_hat') or any other generic functions.... Does that make sense?
I have managed to color the rows of a data grid object separately, however giving them a nice tween effect is proving to be more tricky. I wish to make it so that when a row is edited it turns gray and then fades back to white.When I edit a single row this works fine. But when I edit a second row the tween shows up on both of them. The sprite sent to gridColor is indeed the same independently of which line I am editing (weird imo).(Each element in my dataprovider has two extra values color and color_to so that it knows when to tween. )Managed to solve it by looking at the datagrid source code and playing around. Below is the solution:
I am trying to figure out how to make the datagrid component have alternating row colors.I have poured over the manual but cannot seem to fine a property to support this
I have a datagrid. It is populated dynamically by an XML file. I need to be able to set each row's text color seperately. For example, if my variable "type" is "urgent", it would be a red text color.I've spent almost 2 hours trying to figure this out. I've tried setStyle, setRendererStyle, setTextFormat and many more and dozens of combinations.
Im having some trouble finding any info on alternating the font colors in a datagrid component, i can alternate the background colours, but i'd like to alternate the font colors of the rows instead.
I have 5 text files that contain a list of 50 items in each file.
I want to bring that information into a datagrid; 1 column per text file. I'd also like to extend the code to add more columns when new files are created.
I was able to bring in one column, but maybe an approach with xml, an xml connector and dataset would be better.
Here is the code so far:
Code: var PATH:String = "10-12-09.txt"; var extIndex:Number = PATH.lastIndexOf( '.' ); var extless:String = PATH.substr( 0, extIndex );
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.
I have a Game-sprite representing a game room with up to 3 players, it works ok. And would like to populate a List component with those Game's, based on an XML data coming from a socket.I've prepared a simple test case demonstrating my problem -ListTest.fla (should have a List component in its Library):
I have a project where I've been asked to allow a user to choose between multple color themes of a character. This object is complex in that it has multiple colors and that each color needs to change differently based on the theme's color scheme.
Is there a way to take a movieclip with multiple colors and apply process to it that will detect different colors and transform them accordingly without taking each individual color, making a movie clip from it, then modifying the movieclip's colors? Each character has a pretty limited color pallette, so this process would only have to find and then change maybe 3 or 4 colors. But the character in question is hand animated and has a LOT of frames, so I'm hoping there's a chance that I can handle this programmatically rather than doing it all by hand with a few hundred extra movieclips to make color changes to.
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.
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 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 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 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?
I am using AS3, I have a problem in displaying the datagrid. The Datagrid text not showing behind mask. If i put outside the mask, then the data(text) will appear. How do I display the datagridc text/data inside the mask layer?
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.