Dynamic Text Change Color?
Hi all,First of all i would like to thank all of you, I've been around allready for a while. looking ,reading but most of all learning allot from all of you.and now what i would like to learn.I saw the menu over at designcharts and was wondering how that was made.I expect it gets its content dynamicly, xml or php that i can understand, but how would you make that rollover effect with dynamic text?i never thoughed it was possible to mask dynamic text.If there is somebody out there that knows how to build it please share it,thanx in advance!G
KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 10-13-2006, 06:30 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
[F8] Change Dynamic Text Color
I have a dynamic text field (title_txt) it is populated through a XML file that defines most of my body elements. I am trying to get my title_txt to change to the color of the secondary color which is also defined in the xml file, but for some reason I cant to get it to work. Here is my code check the //header section to see where I am ahving problems
Code:
function getMenuNode ()
{
var xmlin = new XML ();
xmlin.ignoreWhite = true;
xmlin.onLoad = function ()
{
headerNode = xmlin.childNodes[0].childNodes[0]
bodyHeader = headerNode.attributes.header;
backgroundColor = headerNode.attributes.bgColor;
primaryColor = headerNode.attributes.primaryColor;
secondaryColor = headerNode.attributes.secondaryColor;
//header
//problem starts here
titleFormat= new TextFormat();
titleFormat.color = secondaryColor;
title_txt.setTextFormat(titleFormat);
// works fine below this
title_txt.text = bodyHeader;
//primary color
var colorPrimaryTrans:ColorTransform = new ColorTransform();
var transPrimary:Transform = new Transform(contentBody_mc);
transPrimary.colorTransform = colorPrimaryTrans;
colorPrimaryTrans.rgb = primaryColor;
transPrimary.colorTransform = colorPrimaryTrans;
//background color
var colorBGTrans:ColorTransform = new ColorTransform();
var transBG:Transform = new Transform(background_mc);
transBG.colorTransform = colorBGTrans;
colorBGTrans.rgb = backgroundColor;
transBG.colorTransform = colorBGTrans;
//logo
createEmptyMovieClip("logo_mc",getNextHighestDepth());
logo_mc._x = 10;
logo_mc._y = 5;
loadMovie("bodyElements/logo.jpg","logo_mc");
}
xmlin.load ("data.xml");
}
Change Dynamic Text Color
So I have this typewriter script that looks like this:
frame 1:
Code:
firstname = "Tom";
_root.strText = "Hi "+firstname+". Allow me to introduce myself.";
_root.counter = 1;
frame 2 (labeled "loop"):
Code:
_root.text1 = _root.strText.substr(0,_root.counter);
_root.counter++
frame 3:
Code:
gotoAndPlay("loop");
I'm looking to get 'firstname' to be a different color than the rest of the text. How can I do this?
Dynamic Text Color Change
Anyone know why this isn't changing the text color on release?
newLetter.onRelease = function() {
var matchFound:Boolean = false;
var clickedLetter:String = this._name.charAt(this._name.length-1);
for (var j:Number = 0; j<chosenWord.length; j++) {
if (chosenWord.charAt(j) == clickedLetter) {
_root.guess_txt.text = displayedText.substr(0, j)+clickedLetter+displayedText.substr((j+1));
matchFound = true;
this._visible = true;
myFormat_fmt = new TextFormat();
myFormat_fmt.color = 0xbbbbbb;
}
Change Color Of Text In A Dynamic Textbox
hi everyone,
does somebody know how to change the color of text in a dynamic textbox via actionscript?
i want to set the text at runtime but also the color, so converting the text to a symbol is not an option (as long as you can'7 convert it at runtime).
any ideas are highly appreciated ...
tia
eman
Change Dynamic Text Color/size?
Hello, I was wonder how you change the color and size of text that appears in a dynamic text field. I tried selecting it and changing it in the "characture" panel, but that doesn't seem to do anything. how would I go about this?
How To Change Color Of A Mc W/ Dynamic Text With Script?
Cannot figure out how to do it.
Since the mc contain a dynamic text box, the color of the text seems to be dominated by the text box color.
I have tried to use setRGB or setTransform but none seems to be working.
But i know i can cgange the color with the tint setting in the property pane, but how can i do it w/ scripts?
Dynamic Text Mouseover Color Change?
So, I have a dynamic menu drawing its info from an external as file. The menu contents are loaded in a textfield inside a movieclip
The question is, can I have that text change color as I put the mouse over it?
- K
Change Dynamic Text Background Color
For some reason I can't get my background changed
ccText_txt.backgroundColor = 0xcccccc;
I have a dynamic text box with instance name of ccText_txt that starts on frame 1 and spans 30 frames. On a separate layer I have functions that are in frame one and that frame goes across all 30 frames as well. The function layer turns the text box on/off.
Any reason the background won't show? I am using MX 2004 pro and publishing as player 6.
Change Movieclip Color & Text Through Dynamic Txt
Ok, I am developing an interface for a client (to display in their office, not web based). I need to include a way to let the client (not Flash or programming savvy) to update part of the interface saying whether or not property has been available, pending or sold. This will change a circle's color and a word (for example, "Sold!" and the circle would now be red). I can make this work through a dynamic txt file, but I have to use 2 txt files (one for the color and one for the text). My questions are these: How can I make this as simple as possible for the client? I would like to change the txt file so they just input "red" rather than "0xCC0000", and not have two txt files. (when I try to integrate them, the circle turns black rather than the color I specify). Lastly, how would I integrate a database if necessary?
My code on the frame:
Code:
// *************************** //
// MovieClip.setRGB() method //
MovieClip.prototype.setRGB = function(newColor) {
(new Color(this)).setRGB(newColor);
};
// end MovieClip.setRGB()
// *************************** //
var a = new LoadVars();
a.load("properties.txt");
a.onLoad = function(success) {
if (success == true) {
trace("Text file load successful");
// variable representing hex number
circle = new Color("lot1");
nColor =_root.a.lot1;
circle.setRGB(nColor);
} else {
trace("Error: text file did not load properly!");
}
} // end onLoad()
loadVariablesNum("propertiestext.txt", 0);
And my color txt file (properties.txt):
&lot1=0xCC0000
And the word txt file (propertiestext.txt):
&lot1status=Sold!
&textloaded=OK
All help is appreciated! Thanks!!!
Change TextArea Color For Dynamic Text
Hello,
So I am trying to have a text area call up a txt file on the root directory of a site I am working on.
The textArea has the instance name of newsText
the text file is called news.txt.
Here is the actionscript code on the first frame (1/1 frames)
ActionScript Code:
var url:String = "news.txt";
var loadit:URLLoader = new URLLoader();
loadit.addEventListener(Event.COMPLETE, completeHandler);
loadit.load(new URLRequest(url));
function completeHandler(event:Event):void {
newsText.text = event.target.data as String;
}
Where and how do I insert the script to change the color of the text to be displayed into the text area? I've searched around for a few days and cannot find anything but long, elaborate scripts that do many things that I do not need.
Please Help!
Change Text Color On Dynamic Menu ?
Hi,
I have a menu text dynamically loaded from external data. It duplicateMovieClips on stage.
The thing that does not work is the onRelease statement. The new color is not applied.
All others (onRollover, onRollout), works perfectly.
How can I set the new color to the text menu when we press on it ?
Here is the AS code on the MC that is duplicated:
Code:
mcbase = new Color(this);
orig = "0xFFFFFF";
overSt = "0x980F08";
this.onLoad = function() {
mcbase.setRGB(orig);
}
this.onRollOver = function() {
mcbase.setRGB(overSt);
}
this.onRollOut = function() {
mcbase.setRGB(orig);
}
this.onRelease = function() {
mcbase.setRGB(overSt);
}
Change Text Color On Dynamic Menu ?
Hi,
I have a menu text dynamically loaded from external data. It duplicateMovieClips on stage.
The thing that does not work is the onRelease statement. The new color is not applied.
All others (onRollover, onRollout), works perfectly.
How can I set the new color to the text menu when we press on it ?
Here is the AS code on the MC that is duplicated:
Code:
mcbase = new Color(this);
orig = "0xFFFFFF";
overSt = "0x980F08";
this.onLoad = function() {
mcbase.setRGB(orig);
}
this.onRollOver = function() {
mcbase.setRGB(overSt);
}
this.onRollOut = function() {
mcbase.setRGB(orig);
}
this.onRelease = function() {
mcbase.setRGB(overSt);
}
If Statement Help - Change Text Color Depending On Dynamic Text
I am trying to change the color of my dynamic text depending on what the actual dynamic text is... for example, if my dynamic text is "This is Red" I want to set the color of the text to #FF0000. Here's the code, just doesn't seem to be working... any help?
Code:
MyTextBox_txt.text=this.MyDynamicVar;
if (this.MyDynamicVar="This is Red") {
MyTextBox_txt.textColor = 0xFF0000; // Make Text Red
} if (this.MyDynamicVar="This is Green") {
MyTextBox_txt.textColor = 0x00FF00; // Make Text Green
} else {
MyTextBox_txt.textColor = 0xFFFFFF; // Default Text to White
}
Thanks for everyone's help!
Dynamic Text Field Won't Change Color When Hovering
Hi,
I attached my .fla file (I think) which contains the problem.
It contains a dynamic textfield with hyperlinks. I want this link to change its color when a rollover occurs.
I thought I could just swap the last frame of my MC with a graphic which contains the rollover, but this doesn't work and I can't figure out why
Color Change And Autosize On Dynamic Text Field
I have a script that loads a .txt file to a dynamic textfield. I need to have the text change in color when the mouseover. I've created a button out of that textfield and created its rollover state. It works fine, but then i also need to automatically resize the textfield to fit nicely with the amount of text loaded.
It works fine with autoSize property if the textfield is not inside a button. But once i put the textfield inside a button, it doesn't work.
This is what i have:
a dynamic textfield inside a button inside a movieclip.
The scripts on root timeline:
Code:
loadVariables ("txtFiles/clientNames.txt","myClip");//this loads fine
_root.myMovieClip.myButton.myTextField.autosize = left;//this doesn't work
Help anyone? Or is there an easier way to have the text color change when mouseover a dynamic textfield?
Thanks in advance,
OnRollOver Font Color Change Of Dynamic Text
I have a movie clip that is acting as a button and the text is being pulled in by from an XML file. This text will be a clickable link. I'd like to change the color of the text in an onRollOver function but it's not working. Any suggestions?
I've tried:
Code:
myFormat_fmt = new TextFormat();
myFormat_fmt.color = 0xE50000;
mod1Pop.onRollOver = function() {
mod1Pop.mod1Title.setNewTextFormat(myFormat_fmt);
}
and it doesn't work. also tried putting that in the actionscript of the movie itself with no luck.
Dynamic Text Filed And Font Color Change.
How can i change font color in dynamic text box. Text is loaded from xml.
And i want to make thisway that when user rolls over this text box, or mc over this text box then font color change.
How To Change Dynamic Text Color Of Bullet Points
Hello,
Can someone please help?
I have added bullet points to my dynamic text in XML file, and can't seem to get them to be any other color than black.
Here is the code that is within the XML file:
<P><FONT FACE="Arial" SIZE="20" COLOR="#FFFFFF"><li>played with Clark and Pete when they were kids; Greg's dad built him a treehouse; never called Clark or Pete after parents got divorced</li></font></P>
The text is correctly displaying in white, however the bullet points are black.
Does anyone have any advice on how to change the color of the bullet point from black to white? Or is there another alternative.
Thanks in advance.
How To Change Color Of Dynamic Text Depending On Variable? Help Needed
I want to change the color of a dynamic text box depending on the variable's value.
For example, I have a dynamic text variable named "status1" which has a value that is loaded from a text file. If the value is "Yes" of status1, then I want to the color of status to be GREEN, if the value is "No", then I want to color to be RED.
Here is what I have right now (though it doesn't seem to work):
loadVariablesNum("data.txt", 0);
//THIS IS THE DATA INPUT FILE
if (status1 == "no") {
_root.status1.color = green;
}
Thanks.
Return MC To Original Color After Dynamic Color Change
How is it done? All I've seen on the web is how to change the color. Well how about going back. I'm talking about a MC with many colors. I can't just change back to a single hexadecimal color.
I can accomplish the change as it passes over a frame, but I can't get it to change back.
In the frame is this:
ActionScript Code:
cHurtColor = new Color(_root.compMC);cHurtColor.setRGB(0x00FF33);
Trying to keep this simple....
Return MC To Original Color After Dynamic Color Change
How is it done? All I've seen on the web is how to change the color. Well how about going back. I'm talking about a MC with many colors. I can't just change back to a single hexadecimal color.
I can accomplish the change as it passes over a frame, but I can't get it to change back.
In the frame is this:
ActionScript Code:
cHurtColor = new Color(_root.compMC);cHurtColor.setRGB(0x00FF33);
Trying to keep this simple....
Dynamic Color Change
I am trying to make the color of a movie change dynamically. If i enter either rgb or hex values... I want it to smoothly change from the previous color to the entered value.
If someone has an ex of such code and would like to share, that would be great, but just an idea to get me starte would also be apreciated.
Thanks
Dynamic Color Change
is it possible to make a mc fade from a blue tint to a red tint with action-script? the fade should be about 10 keyframes and just like a motion tween. it has to be done with actionscript, cause i want to be able to fade it into different colors and i cant make every animation (green to purple, purple to orange, organge to green, etx.)
anyone? thanks!
Dynamic Color Change
Hello,
I really need someone to point me in the right direction.
I would like to create a number of invisable buttons each one that change a single mc to a different color and display the color's name- sounds simple !
Can it be done through actionscript ?
Something like -
on(rollOver) 'invis_btn_01' change 'color_mc's' rgb value to #FFF and add this name to mc's dynamic text field "white"
on(rollOver) 'invis_btn_02' change 'color_mc's' rgb value to #000 and add this name to mc's dynamic text field "black"
I'd like to keep file size to min and everything nice and clean
cheers !
Dynamic Color Change
Does anyone know how to dynamically change the color of something by using actionscript having it fade into that color instead of it just becoming that color? I know you need to use an array to store the colors and then you can pull them up when lets say a button is clicked. But how would you make it fade into that color and not just change.
Dynamic Color Change?
i work at this place that does tons of partner sites for our main company, that all the same site, just with different color schemes and logos. i'm in the middle of redoing a lot of the elements and making them flash based. i realized if i can have a way of maybe dynamically loading the colors on the page from an exteral php or xml document, that i would save myself and other much work in the future.
does anyone know if a way to do this? to load the color of something from an external document? i'm taking about fill colors here. i think i've seen it done with componients, but is there a strictly actionscript method?
Dynamic Color Change
Is there a way of tweening colour using actionscript. Like you would using an alpha fade but using color instead.
Say I have a button that once pushed it turns a square from orange to blue, but gradually fading.
I would much appreciate any help, thanks.
Dynamic Color Change?
i work at this place that does tons of partner sites for our main company, that all the same site, just with different color schemes and logos. i'm in the middle of redoing a lot of the elements and making them flash based. i realized if i can have a way of maybe dynamically loading the colors on the page from an exteral php or xml document, that i would save myself and other much work in the future.
does anyone know if a way to do this? to load the color of something from an external document? i'm taking about fill colors here. i think i've seen it done with componients, but is there a strictly actionscript method?
Dynamic Change Car Color
It's not a new function.
You can find the effect I am talking about by clicking "Color Options" from the main menu button "Gallery".
http://mazda.be/subsites/rx8/_nl/start.htm
Dynamic Color Change...been Dane?
I need a function that can receive the RGB values that I feed to it and then it would programmatically fade the current RGB (tint) values of the target MC to the new values. creating a color shift (not snap) that I could trigger dynamically. has anyone seen anything like this? this must have been done. Thanks!
Random Dynamic Color Change
Hi! At some point in my movie I duplicate an mc (a simple ball) several times and I want each duplicated ball to have a different color chosen at random.
How can I go about it?
Thanks very much for any help.
Change Color Of Dynamic Button
I created buttons using this code(from the library)
_root.lines.attachMovie("Button", "button"+i+p1+p2,i+p1+p2);
_root.lines["button"+i+p1+p2]._height = 10;
_root.lines["button"+i+p1+p2]._width = 10;
_root.lines["button"+i+p1+p2]._x = posx[i];
_root.lines["button"+i+p1+p2]._y = posy[i];
// _root.lines["button"+i+p1+p2]._RGB=(0x00ff00);
//_root.lines["button"+i+p1+p2].color= "#176C34";
_root.lines["button"+i+p1+p2].backgroundColor = 0xFF0000;
_root.lines["button"+i+p1+p2].color = 0x0000FF;
_root.lines["button"+i+p1+p2].textColor = 0xFFFFFF;
I am not able to figure out how I can change the coor of the button dynamically
Can anyone help please?
Random Dynamic Color Change
Hi! At some point in my movie I duplicate an mc (a simple ball) several times and I want each duplicated ball to have a different color chosen at random.
How can I go about it?
Thanks very much for any help.
Dynamic Color Change Function
Hey gang. I'm making a thing where I need the color of several different things to change gradually and dynamically (on certain item clicks).
I setRGB so I can the getTransform to subsequently color.rb +=, so I can transition the colors fine. My "problem" is that i'm trying to develop it as a function so I can simply call the function for each item that needs to color change rather than repeating the same code a bunch of times for each item.
I tried making a Color.prototype, no luck, I tried making a MovieClip.prototype, no luck. I basically need a way to pass the color of an item to a function and then onEnterFrame it into changing. So function? Prototype? Something else?
Code:
oldColor = grass_color.getTransform();
//to get starting colors
arby = oldColor.rb;
gebe = arby;
bebe = gebe;
//Grayscale transition so R G and B all the same
n = 30+Math.round(Math.random()*30);
//random number of frames (between 1 and 2 seconds at 30FPS);
c = Math.round(Math.random()*100);
//new target color;
i = 0;
changer = holder.createEmptyMovieClip("changer", 1);
changer.onEnterFrame = function() {
if (i<n) {
i++;
oldColor.rb -= (arby-c)/n;
oldColor.gb -= (gebe-c)/n;
oldColor.bb -= (bebe-c)/n;
grass_color.setTransform(oldColor);
} else {
removeMovieClip(this);
Dynamic Color Change Problem Please Help.
Hey Guys, Code is provided below. I have an example or what works and what doesn't. I am about to throw my computer out the window.
This code works:
function paCountyHighlight(targetCounty) {
var myColor:Color = new Color(this.usa.pa_counties.Washington);
myColor.setRGB(_root.hoverColor);
_root.countyLabel = targetCounty+", PA"_root.displayCountyLabel();
When I change it to support my needs it does not work! I have tried hours on end to get this going:
function paCountyHighlight(targetCounty) {
var countyColored = this.usa.pa_counties.targetCounty;
var myColor:Color = new Color(countyColored);
myColor.setRGB(_root.hoverColor);
_root.countyLabel = targetCounty+", PA";
_root.displayCountyLabel();
}
You should be able to see what I am trying to do. I am trying to use the parameter rather than the hard-coded county name. I tried a million different ways to call this county to change color. I even tried the setTransform method. PLEASE shed some light on this for me.
Dynamic Change Of Color For Graph
i tried duplicating a movie clip of a bar with animation that tweens upwards and changes colors from red to green when it reaches it's last keyframe.
however, duplicating the movieclip only duplicates the first frame of the movieclip and not the rest of the animation.
so i'm looking for a way to dynamically change the color of the movieclip based on it's _y position instead, however i don't know how to dynamically change the color from red to green using only actionscript.
here's the code i used
Code:
stop();
this.onEnterFrame = function(){
/* creates bars */
for(counter=0;counter<=10;counter++){
duplicateMovieClip (_root.bar, "bar" + counter, counter);
}
/* this places the bars in their places */
for (counter=0;counter<=10;counter++){
this["bar"+counter]._x = 42+this["bar"+(counter-1)]._x ;
this["bar"+counter]._y = this.bar._y;
}
colorshift = new Color("_root.bar");
colorshift.setRGB(0x006699);
}
i also would like to know how to preserve the image gradient within the movieclip
or is there a way to just change the percentage of the RGB (like in properties>color>advanced option) because my current code changes it into a single color and makes the image look flat.
Dynamic Color Change + Tint?
I have a shape whose color is changed when this button is pressed:
new Color([shape_selected]).setRGB(0xff0000);
I would also like this shape to have a rollover effect since eventually I'm going to have a ton of shapes and it will be hard to differentiate between them when selecting one. Tint seems to work the best visually, but I'm using this thing:
http://proto.layer51.com/d.aspx?f=143
and it resets the color of the shape back to what it was originally, so it undoes what the button does.
Any help? I would be pummmped! thanks!
Mouserover/color Change In A Dynamic Textfield
First.. a fantastic page here: http://www.weworkforthem.com/wwft.html
Me and a couple of friends have been wondering, how they do that color change on the links(mouse over) effect.. iwe been speaking with one of the designers at wwft, who told me that they loaded the txt from a .txt file into a dynamic txtfield.. and then used a script on the txtfield that changed the color effect on each link when the mouse was over!
(due to © he wasnt allowed to make the script public!)
Anyone have any idea how? or experience with making this?
Alive@4b4.dk
Kasper
Dynamic Color Change With Alpha On Tint
is it possible to apply a dynamic color change with alpha tint to an mc using actionscript, i would use this to chnage it normally:
code:
myColor = new Color(this);
myColor.setRGB(0xFFFFFF);
can this also incorporate tint so that i could specify an RGB and alpha value?
thanks.
[MX] Problem With Dynamic Color Change Using SetTransform
I am working on an interface that allows the user to alter the "brightness" and scale of an image (image_mc). The ActionScript I am using to alter the "brightness" incorporates the Color object (colorObj) and increments or decrements the ra, ga, and ba values by 5 (using variable "i") when either of two buttons is pressed.
The AS is as follows:
code:
colorObj = new Color(image_mc);
var i = new int;
_root.brightUp_btn.onPress = function() {
i = i+5;
colorObj.setTransform({ra:100,rb:i,ga:100,gb:i,ba: 100,bb:i,aa:100,ab:0});
}
_root.brightDown_btn.onPress = function() {
i = i-5;
colorObj.setTransform({ra:100,rb:i,ga:100,gb:i,ba: 100,bb:i,aa:100,ab:0});
}
The "brightness" effect works, but only for the first 15-25 presses of the button. For some reason that I am completely unable to comprehend, depending on the amount that the variable "i" is incremented or decremented, the image will reset the altered ra, ga, and ba values to 0 after the function is called a certain number of times (that being 15 -25 times). I considered that I might be pushing the value of ra, etc., too high or low, causing it to reset to 0, however, the values of ra-ba can range from -255 to 255 while, in my case, the value resets before it reaches 100 or -100.
My abilities with ActionScript are, I'm sure, far from perfect. If someone knows what I am doing wrong or another way to write this code I would love to hear it.
-ZR
Dynamic Color Change With Alpha On Tint
is it possible to apply a dynamic color change with alpha tint to an mc using actionscript, i would use this to chnage it normally:
ActionScript Code:
myColor = new Color(this);
myColor.setRGB(0xFFFFFF);
can this also incorporate tint so that i could specify an RGB and alpha value?
thanks.
Change The Color Of A Dynamic Txt Field @ Runtime?
Is it possible to change the color of several dynamic text fields @ runtime?
I have already have the site innovativedesigns The user is able to change and save some aspects to the site but the color of the dynamic text fields is not one of them. I am sure i have asked this question before but forgot to check it out.
Anyone
cheers
|