Change Color Dynamically.
I have one image(bitmap) of t-shirt and I want to give user the possibility to change its color. For example, when user selects 'blue', white t-shirt becomes 'blue'. Please, advice me the way how to realize that. May be using masks and color effects (tint), but i need to do it in actionscript.
The example of what I need you can find here: http://www.customink.com/cink/r.jsp?R= (but this application is made in Java).
FlashKit > Flash Help > Flash ActionScript
Posted on: 09-10-2004, 04:56 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Change MovieClip RollOver Color(NOT Single Color, But Gradient) Dynamically ?
hi
I have created this for single color.But how to change when it is a gradient color.
for single color rollover code.
Code:
rollcolor = "0xFF0000";
normalcolor = "0x339900";
my_color = new Color(my_mc);
my_mc.onRollOver = function() {
my_color.setRGB(rollcolor);
};
my_mc.onRollOut = function() {
my_color.setRGB(normalcolor);
};
Thanks in advance
How To Change MovieClip RollOver Color(NOT Single Color, But Gradient) Dynamically ?
hi
I have created this for single color.But how to change when it is a gradient color.
for single color rollover code.
ActionScript Code:
rollcolor = "0xFF0000";
normalcolor = "0x339900";
my_color = new Color(my_mc);
my_mc.onRollOver = function() {
my_color.setRGB(rollcolor);
};
my_mc.onRollOut = function() {
my_color.setRGB(normalcolor);
};
Thanks in advance
Change A Box Color Dynamically
Hey Everyone,
I am trying to change the color of a box based on variables taken from an XML file. As of now I can get the color variable in no problem, however I am not sure how to change the color of the box. The box can be a symbol, or not a symbol it doesn't matter to me. Any help would be great!
Thanks!
Change Bg Color...dynamically...
ello everyone....can anyone point to me how to change the bg color dynamically when we press the button as u can see here http://www.itworks.com.pt
hope someone can give a hint...tq...
Can Anyone Dynamically Change Text Color?
Hi all,
is there a way to dynamically tell flash what font color to use on a dynamic text field? (i dont mean the obvious method in the text panel!!!!)
I am loading in content using XML, but cant change the colour of the text dynamically - if i was using HTML tags from a txt file i could use the <font color=...> tag and attribute, but i havent yet worked out how to place these tags within my XML, either as part of text nodes or as element attributes?
Can you dynamically affect the colour of a text field in Flash???
thanks in advance
gilesb
Can I Change The Color Of Shape Dynamically ?
I want to change the fill or line color of a shape using actionscript...how can i do this ?
Or would i have to make it a graphic or movieclip and use tint..?
But then it would be hard to get a SPECIFIC color...
Change Color Dynamically From Movieclips
I have movieclips that are shapes. I want to change the color and properties dynamically through actionscript. I know I can do it by actually typing out the actionscript and making it a Sprite. However, I like designing it on the stage. Is there a way I can do this?
Dynamically Change Text Color W/ AS?
Hi:
I've got 56 text fields (not input boxes, just a person's name).
In HTML I can set a class and a Stylesheet to change the color of any of them on rollOver (mouseOver in HTML).
Can I do that in Flash? If so, how?
Can I do it without writing a script for each individual instance like I can in HTML?
Dynamically Change Fill Color
How can I dynamically change the color of fill for something created like this:
ActionScript Code:
this.createEmptyMovieClip("myClip",_root.getNextHighestDepth());with (myClip) { beginFill(0xffffff,100); moveTo(0,0); lineTo(50,0); lineTo(50,100); lineTo(0,100); lineTo(0,0); endFill;}
I'd like to change the fill color onRollOver, onRollOut, onRelease, etc., but I don't know which property to refer to.
I think this link probably would have answered my question, but unfortunately it's now dead:
Quote:
Originally Posted by senocular
http://www.toolblast.com/interactive..._from=&ucat=2&
Change Background Color Dynamically
Hi! I have a movieclip in a scene. I want to be able to change the color of one certain object/graphic in the movieclip without hardcode it. Is this possible?
Dynamically Change Color Of Selected Text
Hi,
how can I change the color of a selected piece of text dynamically?
I tried somethings like this (the function is called by a button):
Code:
function changeColor() {
Selection.setFocus(textFieldname);
Selection.setSelection(begin, end);
sel = textFieldname.text.slice(begin, end);
sel.textColor = "0xFF0000";
}
but I guess 'sel' isn't a string, so i can't add textColor to it?
Adding something like:
Code:
sel = new String(begin, end);
doesn't help much.
thank you,
Jerryj.
How To Change Color Of A Dynamically Generated Text
hi,
pl pl help me......its very urgent for me.
I have developed a XML based image gallery. According to the xml length my script generates number on the stage like
1 2 3 4 5 6 7 8 (instead of thumbnails i have generated numbers )
then i gave click event to each number to show large image.
now i want a highlighter. that means when the user clicks on a particular number that number will turn into 'red' color and when the user clicks on other number the previous number will get back to its original color and the clicked number will turn into 'red' color.
how would i do this??
How Could We Change The Color Of The Symbol Dynamically Not The Instance
hi guys,
i need to change the color of the Symbol(movieclip), Dynamically
i dont want to change the instances color directly...
Let me explain in details
I have a symbol name ball..its color is blue
i have around 10 instances with 10 name on the maintime line
what i need now is if i want to change the color of the symbol...so that all the instances get changed. this should happen dynamically by AS in the symbol only...
Regards,
Mohan.
I Am Deperately Trying To Change The Background Color Dynamically ?
Hello everybody,
i am actually working on a portfolio website. I want the background color change each time we click on a button on the navigation bar. My problem is that when you click on a button it changes the background from the start
(white background), not from the previous one clicked.
i am trying to make the effect on this site www.mecompany.com.
can someone please help me, i am in despair.
thanks
Attach Code
stop();
function chgAbout(event:MouseEvent):void
{
background_mc.gotoAndStop(1)
}
function chgPrint(event:MouseEvent):void
{
background_mc.gotoAndStop(2)
}
about_btn.addEventListener(MouseEvent.CLICK, chgAbout);
print_btn.addEventListener(MouseEvent.CLICK, chgPrint);
Dynamically Change Color Of Selected Text
Hi,
how can I change the color of a selected piece of text dynamically?
I tried somethings like this (the function is called by a button):
Code:
function changeColor() {
Selection.setFocus(textFieldname);
Selection.setSelection(begin, end);
sel = textFieldname.text.slice(begin, end);
sel.textColor = "0xFF0000";
}
but I guess 'sel' isn't a string, so i can't add textColor to it?
Adding something like:
Code:
sel = new String(begin, end);
doesn't help much.
thank you,
Jerryj.
How-to Dynamically Change Color Of The Bkgd Of The Movie W/ Btns
I can do this with movieclips, but as to getting the whole movie background color to change color via actionscript & w/ btns, and transition from color to color, like http://www.braingiants.com , aswell I noticed their movie resizes to the browser window, with the swf (in the HTML source) was set as
h: 100% by w: 100% aswell as "noscale" was on, I'm stumped, any tuts or coding examples or help would be great, I think I'm missing some coding or maybe I'm going about it the wrong way, AS wise.
How-to Dynamically Change Color Of The Bkgd Of The Movie W/ Btns
I can do this with movieclips, but as to getting the whole movie background color to change color via actionscript & w/ btns, and transition from color to color, like http://www.braingiants.com , aswell I noticed their movie resizes to the browser window, with the swf (in the HTML source) was set as
h: 100% by w: 100% aswell as "noscale" was on, I'm stumped, any tuts or coding examples or help would be great, I think I'm missing some coding or maybe I'm going about it the wrong way, AS wise.
Text Color And Background Color Setting Dynamically
How would I go about setting the background color of a flash movie as well as the text color of a text box based an external variable?
I want to pass in both of these colors in the <object> tag
myfile.swf?bgcolor=red&textcolor=white
Please advise.
Thanks
Robert
Hex Color Code To Change Movie Clip Color
Hi all, Sorry real quick,
i've got a text box with the text with a hex code from a color picker which reads say "FF0000" how do i use that hex code(FF0000) to change a movie clips color.
simple (me stupid)....
thxs for any help
jon
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....
Button Change Color On Select, Then Change Back
I have 3 buttons, named but,but2,but3. What I want is if you click a button it changes color to show what page your on. But when you click a different button now that one is highlighted and the original one goes back to the original color. Here's the code.
but3.onPress = function () {
_root.createEmptyMovieClip("container", 1);
loadMovie("banner3.swf", "container");
container._x = 0;
container._y = 0 ;
I figure I have to add some kind of if statement?
}
[F8] Color Swatch Or Change - Color Object?
You know how on retail sites or even a car site you can swap the color by clicking on the swatch and than the image changes the color. I wanted to do this in flash preferably with actionscripting but I have NO CLUE how to do it. Can anyone show me a tutorial or advise me o how to do this. This is just a BASIC example in flash five but this is the same concept I want. http://www.adobe.com/support/flash/i...y/colorobject/ If anyone knows of a high level example with tutorial I would appreciate it.
Turtle
Random Color + Change Color With AS With Ease
HI,
I followed this tutorial , but IŽd like to add something more but donŽt know how.
I[d like to make the MC to load a random color, in a color range that I specify, like #000000, #FFFFFF and #111111.
Also, I want somew buttons to change between this colors, but with an ease transition.
How can I do this?
Drag Color And Change Objects Color
i looked at the kirupa's paint tutorial and it really didn't achieve the effect that i'm going for. i'm new to actionscript so i can't figure it out for myself, so i'm hoping someone can shed some light on the situation for me.
here is the setup: i have an object that i rendered in 3d studio max. will just call it a box. i have rendered that box in 3 different colors. red, yellow, and blue. i saved them each individually as targa files and imported them into flash. i created a movie with 3 frames. frame one contains the red box image, frame 2 contains the yellow box, and frame 3 contains the blue box. each frame has the stop command applied to it.
now on the main timeline, i have 3 different circles that have been converted to buttons each colored red, yellow and blue. now i can use a "tellTarget" type action to make the playhead on the box movie clip to jump to the corresponding colored circle that was clicked, but i'd rather let the user be able to drag the colored circle to that box, release, and change the box to the color that corresponds to that circle. i don't know if that requires some type of collision detection script or not. the box has no background so all there is, is the box itself so collision detection should just detect the box itself...right??
i would appreciate any insight that you could give me!!! if need be, i can supply a *.fla file for you to look at.
Random Color + Change Color With AS With Ease
HI,
I followed this tutorial , but IŽd like to add something more but donŽt know how.
I[d like to make the MC to load a random color, in a color range that I specify, like #000000, #FFFFFF and #111111.
Also, I want somew buttons to change between this colors, but with an ease transition.
How can I do this?
How Dynamically Change The Image In Dynamically Created Row Of Images?
Hi everybody,
I am wondering if someone can help me to find out on how to replace the images in row of dynamically loaded images. I need on Press of an icon from the row of images replace the image of this icon to new one. Below is the code of creating the images row based on array and XMl data. I create an array based on data taking from XML.
Code:
var numOfImages:Number;
var thumbHeight:Number = 8;
var thumbSpace:Number = 100;
var thumbTotalDistance:Number = thumbHeight+thumbSpace;
var xCounter:Number = 5;
var thumbsCollectionHeight:Number;
var currentImage:Number = 0;
var moveOutDist:Number = 10;
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
var IM_Img:Array = new Array();
var IM_Title:Array = new Array();
//==================================================================================================================
//=============================== THUMBS IMAGE LOADER ==========================================================
//==================================================================================================================
var thumbImgLoader2:MovieClipLoader = new MovieClipLoader();
var thumbImgListener2:Object = new Object();
thumbImgListener2.onLoadProgress = function(target:MovieClip):Void {
};
thumbImgLoader2.addListener(thumbImgListener2);
thumbImgListener2.onLoadComplete = function(target_mc:MovieClip):Void {
};
//==================================================================================================================
//=============================== XML ==================================================================================================
//==================================================================================================================
var totalXML:XML = new XML();
totalXML.ignoreWhite = true;
totalXML.onLoad = function(success) {
var TNnode = this.firstChild.childNodes[1].childNodes;
numOfImages = TNnode.length;
//---------------- ATTACHING THUMBS -----------------
//===========================================================================================================
for (i=0; i<numOfImages; i++) {
var mc:MovieClip = imCollection_mc.thumbs_mc.attachMovie("mcThumb_IM", "thumb_" + i, i);
mc._y = 0;
mc._x = xCounter;
xCounter = xCounter+thumbTotalDistance;
thumbImgLoader2.loadClip(TNnode[i].attributes.thumb,mc.loader_mc);
IM_Title.push(TNnode[i].attributes.title);
imCollection_mc.thumbs_mc["thumb_" + i].mc_title.title_txt.text = IM_Title[currentImage];
mc.id = i;
trace (mc.id);
mc.onPress = mc_im_onPress;
mc.xx = mc._x;
mc.yy = mc._y;
}
};
//-------------------------------------------------------------------------
totalXML.load("images.xml");
Here is onPress event where I was thinking to add this functionality:
Code:
function mc_im_onPress() {
mcToSelect = this;
if(this.id==8){
//here I need to tell to replace the image from mc8 to new image from array to image#34 from xml
}
}
Any advice is highly appreciated. Thanks.
Using A Color Chooser To Change Color Of MC
Hi,
I'm using a component which allows you to change the color of MCs but I can't get it to work...newbie sorry...
I have an MC on the stage with the instance main_mc which contains another MC called back_mc as well as a Mc (button_mc) which contains the component on frame 2 (ColorChooser) with this script :
code:
stop();
var myCol:Color = new Color(back_mc);
ColorChooser .changeHandler = function() {
myCol.setRGB(main_mc.back_mc.value);
};
Sorry if this is all very confusing...a path issue probably but I can't figure it out. Could someone help me please?
G
Color Change (heavy Change)
Hey everybody,
i dont know if this is possible, but it sure would be nice! I need to change all the elements in my movie that have the color X and change their color to color Y.
Is it possible to have this in AS? like, if i press one button all the elements that have the color black (graphic, text, background, etc) change their color to yellow?
thanks for any thoughts!!
cheers
Is This Possible? Change Color
Hello,
i have a MC which has only a square.
Is it possible to change the color of that square with action script?
thanks,
Miguel
Color Change
is it possible to transform(with fade effect) the color of a movie clip or a graphic, ive tried the .setRBG and .setTransform, but the color changes right away without the fade...if u kno what i mean plz reply thx
Change Color
I'd like change color of MC bgLista which is inside of MC messaggio. But with (messaggio" add i.bgLista) I can't reach
bgLista and the change color is on messaggio.
What's wrong?????
for (i=0; i<array_length; i++) {
duplicateMovieClip(messaggio, "messaggio" add i, depth);
setProperty("messaggio" add i, _y, yposition);
set("messaggio" add i add ".ListaIdmessaggio", ListaIdmessaggio_array[i]);
set("messaggio" add i add ".ListaDataora", ListaDataora_array[i]);
set("messaggio" add i add ".ListaNickname", ListaNickname_array[i]);
set("messaggio" add i add ".ListaOggetto", ListaOggetto_array[i]);
Lista = new Color("messaggio" add i.bgLista);
i%2==0 ? Lista.setRGB(0xCCCCCC) : Lista.setRGB(0xffffff);
delete Lista;
depth--;
yposition = yposition+25;
}
Thanks in advance
manner
Help Using AS To Change Color
Hi Everyone,
I'm trying to change a small spinning house MC named "house" to a different color using AS... I would like it to change using the hittest method when you just rollover it ... or....
I would like when you rollover the invisable button I have over it to have the rollover code to change the color of the house MC... this is what I have on the invisable button right now and it isn't working:
on (rollOver) {
black = new Color(house);
black.setRGB(OxFFCFCF);
}
on (release) {
gotoAndPlay ("home");
}
FFCFCF is the hexidecimal color I would like to change it to. I would like it to be like a tint function. I got this portion of code from one of the tutorials on the site but I think I have somehow messed it up.
Thanks in advance.
Dwyermm7
Color Change
Is there a way for movie clips to reference a variable in order to set their fill and outline color? I thought it would be advantageous to set up some code for the 'interface' portion of a site to make color changes easy. I've checked out the .new Color actionscript but I'm not sure it would handle what I'm after. Any thoughts or links??
Thanks!
BlueRhino
Change Color
Hello,
i want to change the color of a MC from red to blue when i move the mouse from a 30 _x position to a 60 _x position.
I want the red color to gradualy change to blue.
Does anyone knows how to create this?
Thanks,
Miguel
Color Change Again
hello,
Can someone explain to me how this is possible in flash 5 please :
change = new Color(movie.colorChange);
change.setRGB("0x",text);
text = "FF00FF";
I want to chaneg a color of a movie clip inside a movie clip but I want the hex value to come from a variable "text = "FF00FF";" like that !
Thank you, please.
Change Color Of MC
Hi!!
Haven't done any flash for a while. I only do it for my own purposes and for friends. I'm making a flash that has a movie clip i want to change colors. Ive searched the forums and tutorials on several sites but can't seem to find the solution to my problem.
I can get it working if i place the actionscript on the main timeline. But i'd perfer to change it inside the mc since the main timeline may get more complex when i add the text animation.
The problem i have is when i try to change the color inside the movie clip (logo_mc). inside logo_mc is another mc named my_logo. my_logo just has a gif image i want to change colors. I'ts just a b&W image.
I use onClip(load) where i define the color and transform objects. Then I have an onClip(enterFrame) where i use random numbers to generate the new rgb values.
When the mc reaches the onClip scripts, i can see the color start to change then it goes back to the original color.
I've used the trace function and noticed that each time it hits the frame with the onClip() that it not only process the onClip(load) each time, but that it seems to go through the onClip(enterframe) statements 3 times...I have 3 statements to get new values for the rgb values...one for each r,g,b. When I put in 3 more variables to generate the ra, ga, ba, values i get what appears to be 6 loops through the onClip(enterframe). Is there a casue and effect here that I'm unaware of?
So here's the code...
onClipEvent (load) {
changeColor = new Color(this);
colorTransform = new Object();
n = 1;trace("GRRRRRRRRRRR");
}
onClipEvent (enterFrame) {
colorTransform.rb = Math.round(Math.random()*255);
colorTransform.gb = Math.round(Math.random()*255);
colorTransform.bb = Math.round(Math.random()*255);
n = 1;
trace(colorTransform.bb);
changeColor.setTransform(colorTransform);
}
This code is in frame 8. where i'd like the color transform to take palce. I've tried it in frame one of the mc but get the same results. Any ideas? The attached fla might expalin things better than i did. It's not very complex.
Thanks!!!
PS looks like file too large with other graphics...sould work now
Change MC Color Through AS
I've a tiny problem. I want to change the color of a circle through actionscript. Is it possible? It would be fantastic if something like this could work:
Code:
_root.cirkle._tint = #5583CE
ofcourse this doesn't work but is there something similar to this?
Thanx in advance.
Nasier
AS Color Change
I have an animation as a movie clip. How can I code it so that the color of it changes(to like a transparent red)? Thanks
Change And MC Color
i want to dynamically change a MC's (just a simple square)rgb value.
i have the three sliders that set variables R,G,B, and each returns a value up to 255.
How now can i use those values now to change the color of the movie clip. I see options for hexadecimal values but not real rgb values.
Any idea could help.
Thanks
Steve
Color Change
hi all!
does anyone know of a script, etc. that will FADE a color from one color to another without keyframing.
the problem is that i have to fade from any one of ten colors to any other of the ten based on the button pressed.
thanks in advance..
-jason
|