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
Ultrashock Forums > Flash > ActionScript
Posted on: 2003-03-24
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Change Dynamic Txt Field @ Runtime(new MX Properties)
hi guys,
I have built a simple form
username
emil
website etc...
on the submit but i have the usual for checking entries in the text fields.
I have started to tinker about with the
"SetNewTextFormat"
Code:
on(release){
if (!username.length) {
username.border = true;
username.borderColor = 0xF3C079;
username.background = true;
username.backgroundColor = 0xffffff;
username.text = "Field missing !";
Selection.setFocus(username);
}
}
works just fine.
Now what i am tring to do is set the origanil state of the text field after the user starts to input the data. I thought i had it but the coding i thought didn't work for me:
example:
Code:
this.onEnterFrame=function(){
if (Selection.getFocus == username) {
username.border = false;
username.background = false;
}
};
Anyone
Cheers
Change Dynamic Txt Field @ Runtime(new MX Properti
hi guys,
I have built a simple form
username
emil
website etc...
on the submit but i have the usual for checking entries in the text fields.
I have started to tinker about with the
"SetNewTextFormat"
Code:
on(release){
if (!username.length) {
username.border = true;
username.borderColor = 0xF3C079;
username.background = true;
username.backgroundColor = 0xffffff;
username.text = "Field missing !";
Selection.setFocus(username);
}
}
works just fine.
Now what i am tring to do is set the origanil state of the text field after the user starts to input the data. I thought i had it but the coding i thought didn't work for me:
example:
Code:
this.onEnterFrame=function(){
if (Selection.getFocus == username) {
username.border = false;
username.background = false;
}
};
Anyone
Cheers
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,
Change Font Color @ Runtime?
Hi guys i am hoping that this is a simple task
Is it poss to change the color of a dynamic txt field @ runtime
cheers
Change The Color Of A Text Field
Hi,
I have a dynamic text field which loads data from a ASP file.
I know how to change the color of a movie clip from external file, but do you know is it possible to change the color of the text field? I cannot convert the text field to a movie clip, because after doing this, I can't load any data from the ASP file.
Please Help!
Thanks in advance.
Change Text Field Color
how i know this maybe is little simple but i m interesting to know how cant i change a text field color.
Example. I have a website form that have required fields. And when some information is missing i want to change to red color the text field to warning the user.
How can i do that?
Bye and thanks
Can Not Get A Dynamic Text Field To Import At Runtime
OK, guys...here are some total assinine questions I am sure, but this is the first site I am trying to develop totally in flash.
I am trying to get it to pull news onto the news page from a txt file, but can not get it to work. I have tried to emulate the way I did it in the tutorial (which worked fine when I did it, of course...story of life), but every time I go to test the file for the news page the text field will not load. I have worked on this for a week to no avail...I really hope someone can help me.
Now, onto another note: I would REALLY like to find a way to import html tables/etc into some of my pages, but can not figure out how. Any suggestions? Please?
Here is the site URL so far:
http://www.wings-of-fury.com
Dynamic Text Field Resize @ Runtime
Hi guys i am trying to find out to resize a dynamic text filed when data is loaded in from the db to populate it so that there is no need for a scroller.
Cheers
Dynamic Text Field Resize @ Runtime
Hi guys i am trying to find out to resize a dynamic text filed when data is loaded in from the db to populate it so that there is no need for a scroller.
Cheers
How Do You Change The Background Color Of A Text Field?
I've been trying to change the color of my text field in FlashMX and I can't seem to figure out how to do it. Couldn't find any tutorials on it anywhere, so I'm posting here instead.
I've got a dynamic text field (loading an external text file) with a scroll bar, but I don't want the background color of the field to be the default white color. How can I change it to something else?
Any help would be greatly appreciated.
Thanks,
-RoG-
http://www.I-Mockery.com
Change Color Of Specific Text In A Field
What I am trying to do is change the color of some text:
here is my code you will notice that near the bottom there is an addMC which splices some text into the array with some formatting. The problem is I want to change the color of that text to red, when I add the color attribute all text after that disappears. Any help will be greatly appreciated.
audioButton.onRelease = function() {
//loads text into buttonMCs
oneMC.gotoandstop(1);
twoMC.gotoandstop(1);
_root.mySound.attachSound("223V43C");
_root.mySound.start("223V43");
////
example2 = new Array();
example2 = ["Use a shovel"];
oneMC.one = example2.join("");
///
example3 = new Array();
example3 = ["Use a drill"];
twoMC.one = example3.join("");
/////////
example4 = new Array();
example4 = [" to dig lose"];
twoMC_two.one = example4.join("");
///
example5 = new Array();
example5 = [" to build large"];
oneMC_two.one = example5.join("");
///
example6 = new Array();
example6 = [" material such as dirt."];
twoMC_three.one = example6.join("");
///
example7 = new Array();
example7 = [" to dig water."];
/////set text in array in one click
oneMC_three.one = example7.join("");
example = ["Use a shovel"];
preview =example.join( "" );
example.push("<b><u> to make big</u></b>");
preview = example.join("");
example.push(" material such as dirt.");
preview = example.join("");
};
check.onPress = function() {
if (preview == "Use a shovel<b><i> to dig lose</i></b> material such as dirt.") {
gotoAndStop(2);
}
else {
gotoAndStop(3);
}
};
oneMC.onPress = function() {
example = ["Use a shovel"];
preview =example.join( "" );
this.gotoAndStop(2);
this.enabled = false;
twoMC.gotoandstop(2);
oneMC_two.gotoAndStop(1);
twoMC_two.gotoAndStop(1);
};
twoMC.onPress = function() {
example = ["Use a drill"];
preview = example.join("");
this.gotoAndStop(2);
this.enabled = false;
oneMC.gotoandstop(2);
oneMC_two.gotoAndStop(1);
twoMC_two.gotoAndStop(1);
};
twoMC_two.onPress = function() {
example.push(" to dig lose");
preview = example.join("");
this.gotoAndStop(2);
this.enabled = false;
oneMC_two.gotoAndStop(2);
oneMC_three.gotoAndStop(1);
twoMC_three.gotoAndStop(1);
};
oneMC_two.onPress = function() {
example.push(" to build large");
preview = example.join("");
this.gotoAndStop(2);
this.enabled = false;
twoMC_two.gotoAndStop(2);
oneMC_three.gotoAndStop(1);
twoMC_three.gotoAndStop(1);
};
oneMC_three.onPress = function() {
example.push(" to dig water.");
preview = example.join("");
this.gotoAndStop(2);
this.enabled = false;
twoMC_three.gotoAndStop(2);
check.enabled = true;
//oneMC_three.gotoAndStop(1);
//twoMC_three.gotoAndStop(1);
};
twoMC_three.onPress = function() {
example.push(" material such as dirt.");
preview = example.join("");
this.gotoAndStop(2);
this.enabled = false;
oneMC_three.gotoAndStop(2);
check.enabled = true;
//oneMC_three.gotoAndStop(1);
//twoMC_three.gotoAndStop(1);
};
addMC.onPress = function() {
// Uses splice funktion to add the "added1" element as the 4th element.
example.splice(1,1, "<b><i> to dig lose</i></b>");
preview =example.join( "" );
oneMC_three.gotoAndStop(2);
check.enabled = true;
};
deleteMC.onPress = function() {
// This deletes one item after item 1.
example.splice( 1, 1 );
// Joins all array elements into a string. So that it can be previewed as a variable. "<br>" is a html code which adds line break.
preview =example.join( "" );
//example.push(" material such as dirt.");
// preview = example.join("");
//this.gotoAndStop(2);
//this.enabled = false;
oneMC_three.gotoAndStop(2);
check.enabled = true;
//oneMC_three.gotoAndStop(1);
//twoMC_three.gotoAndStop(1);
};
How Do You Change A Text Field's Color With Code?
I would like to change the color of a text field when certain events occur. Here is how I am attempting to assign a color change to my text field, tagSpeed.
ActionScript Code:
shipOne.dataTag.tagSpeed.color = 0x006699;
ReferenceError: Error #1056: Cannot create property color on flash.text.TextField.
My text field was not created with code, but with the flash tools. Can such text fields be later manipulated with code?
Ken
Input Text Field - Change Color
How about this....
How do you ....When a user clicks a text input box the color and text changes?
i.e. the text box is blue with "Name" in it. When the user clicks in the text input box the word "Name" disappears and the color changes to white.
Everyone has been so helpful. Thank you
Please help on this one too
Change Text Field Color On Click
Hey guys. Just a quick question. I have a dynamic text field that updates when an mc is clicked. Just wondering how I can change the color property of the text when when the
on click event happens.
Thanks.
Input Text Field - Change Color
How about this....
How do you ....When a user clicks a text input box the color and text changes?
i.e. the text box is blue with "Name" in it. When the user clicks in the text input box the word "Name" disappears and the color changes to white.
Everyone has been so helpful. Thank you
Please help on this one too
Dynamic Text Field During Runtime, Word Wrap
Hi
I have this code fragment on a frame:
this.createTextField ("tData",this.getNextHighestDepth (),189,353,600,100);
tData.text="Alcohol is a powerful drug cause by fermentation of sugars and is the active principle of intoxicating drinks";
I have placed the text onstage during runtime, starting from 189, however, the text is longer than what I have specified. I have specified 600, 100. I do not want to increase the length. How do I wrap the text so that it fits instead of disappearing off the stage? What is the additional code I need to embed?
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....
Change Text Field Color (weird Result)
Please, anybody knows why this is happening? I have this dynamic Bounce Menu. Text field need to change color on rollOver. I added some code to the original one l but the text field changes it color only half.. I refer to the main buttons. please check and see what I mean. Why is this?
thanks a lot
Paula.
Input Text Field Selection Change Color
Hi people!
Here's the challenge. I want in my text input field (on black background white letters) change the selection color (when I select typed text by mouse) to something contrast (like grey or red for example). Because right now it's black on the black bg. How can I do this?
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
Changing Dynamic Text Field Color
Is it possible to change the color of a dynamic text field through Actionscript? I'm using 2.0. I know how to change a button or mc color, but not a text field. The text field is currently defined as a string. Thanks.
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.
[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?
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 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
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.
|