Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Change Color For More Mcs With Color Object At A Time



This changes color of one mc:

Code:
myColor = new Color(myMovie);
myColor.setRGB(0x993366);
Is there a way if I have dozen of mcs to change color at a time for all this mcs?

Thank you



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 06-08-2006, 03:08 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Change Color For More Mcs With Color Object At A Time
This changes color of one mc:

Code:
myColor = new Color(myMovie);
myColor.setRGB(0x993366);


Is there a way if I have dozen of mcs to change color at a time for all this mcs?

Thank you

Change Color For More Mcs With Color Object At A Time
This changes color of one mc:
Code:

myColor = new Color(myMovie);
myColor.setRGB(0x993366);

Is there a way if I have dozen of mcs to change color at a time for all this mcs?

Thank you

[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

Change Color With AS Over Time
I've been digging in the forums and I'm trying to find a way to change a movieclip's color over a period of time using actionscript. I've found a lot of examples using setTransform but none are doing it over a period of time.

Basically the effect I'm going for it to have a picture fade in over another picture, but when it fades in, it's like a burst of white light. I know you can do it on the timeline under the advanced settings and up the RGB values by 100, but how do I do this with AS over a period of time.

Thanx in advance.

How Can I Get The Picture To Change Color And Have Sound At The Same Time?
can anyone tell me how can i get this result for the flash file i attached;

1. make the sound appear (i could not import the sound to the library cause the file size is too large),when the user clicks on the black square on the stage,

at the same time.....

2. make the sound appear when the user press the key on the computer keyboard, "a" ,

3. make the square change to another color (eg: black square to a blue square)when the user does step 1 and 2.

i tried using this code.. but i wouldn't work:

ActionScript Code:
on(press, keyPress "a"){    function check()                 {    Key.isDown(65) ? a._visible=1 : a._visible=0;    }    setInterval(check, 50);        soundObj = new Sound( );    soundObj.attachSound( "doremi" );    soundObj.start();}

what is the correct way to do it?

How Can I Get The Picture To Change Color And Have Sound At The Same Time?
can anyone tell me how can i get this result for the flash file i attached;

1. make the sound appear (i could not import the sound to the library cause the file size is too large),when the user clicks on the black square on the stage,

at the same time.....

2. make the sound appear when the user press the key on the computer keyboard, "a" ,

3. make the square change to another color (eg: black square to a blue square)when the user does step 1 and 2.

i tried using this code.. but i wouldn't work:

ActionScript Code:
on(press, keyPress "a"){    function check()                 {    Key.isDown(65) ? a._visible=1 : a._visible=0;    }    setInterval(check, 50);        soundObj = new Sound( );    soundObj.attachSound( "doremi" );    soundObj.start();}

what is the correct way to do it?

How Do I Change The Color Of A Movieclip Each Time It Loops?
I have a hexagon that follows a motion path.  This motion path is a movie clip, and so is the hexagon inside the motion path movieclip.  Each time it loops I want it to randomly choose between 4 colors.  Any ideas?  I was trying to create a function using the Color object, but it didn't seem to work for movieclips inside a movie clip for some reason.  Any help would be great.  Thanks in advance.



I Want To Change Color Of Object W/ Rollover
I have 6 identical pics of a couch, just different colors. I want to put 6 swatches beside the couch that when rolled over will change the color of the couch.
Thanks,
Chas

Change The Color Of An Object From External Txt?
I have a client that would like to be able to change the color of a few objects in a swf by changing something in an external txt. Is this possible?

If so, can you tell me how?

Thanks!
Furpants

OnEnterFrame Change Color Of Object
A colored ball sits on the stage, it's _x and _y changes as you advance in frame 1 and 2, on frame 3 there is a reset button that takes you back to frame 1 and the _x position is reset using _x. math random ()*300. Anyway of also setting hue using the color matrix filter (or change color filter or anything ???) to a random value between -180 and 180?- Just want to change the color every time you reset. Thanks

TextColor; SetInterval: How Do I Set The Color Of The Text To Change After A Set Time
Code:
inpAnswer.textColor = 0x1BED2F;//green
setInterval(_global.timer,20000);
inpAnswer.textColor = 0x000000;//black
I want to try something like this. How do I set the color of the text to change after a while?

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 Color Object (file Attached)
I attached a file in order to make things more clear.

As you can see the color in the "color pallete"
are MovieClips (but I don't mind using buttons instead).

At the left side of the scene there are 3 objects
(MovieClips as well):
1. cube
2. triangle
3. Circle

And there's an active-color box as well.

When I'll click a color on the color pallete the color in the active-color box will chnage to the choosen color, then when I'll click an object (no matter what object) it will change it's color to the choosen color, and so on... if I'll choose another color the active-color box will show the choosen color and when I'll click an object it will change it's color to the new choosen color.

any help is good

Can I Change The Alpha Color Of An Object By Actions?
Hi there, please I need some help, It does exist a simple way to make motion tweens by actions? I mean can in change the alpha color of an object from 0 to 100% by actions and not for frames? or move and object from left to right without apply motion tweens frame by frame?. Thanks for the collaboration.

Lt.

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....

How To Change The Color Of An Object Inside A Movie Clip
can someone please tell me how would i be able to change the color of an object inside a movie clip. i want to click a button on the main scene and be able to change the color of something inside of a movie clip. i got to as far as ...

on (release) {
var boxColor = new Color("box1.bcolor");
boxColor.setRGB(parseInt(input,16));
}

where box1 is the name of the clip and bcolor is the variable name of the box. on release is an object action of a button at the main scene.

thanks alot for anyone who can help.

Using A Loaded Variable From A .txt File To Change The Color Of An Object
Does anyone know if its possible to use a .txt file to change the color of an object? It would be awesome if i could figure this out, its hurting me inside. If this isnt possible, it should be!

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?

Setting The Color Of Multiple MCs Using One Color Object
Hiya I am making a movie that has to be published to Flash Player 6 and want to set a bunch of movie clips to have the same color. Here is my function:

ActionScript Code:
var fillObjs_ar:Array = [square_mc, circle_mc];function colours(array:Array, color) {       for (i=0; i<array.length; i++) {        var my_color:Color = new Color(array[i]);        my_color.setRGB(0x+color);    }}colours(fillObjs_ar, FF0000);

My problem is that I get the error message:
"Hexadecimal digits expected after 0x" referring to the 4th line of my function.
If anyone could help me out it would be really appreciated.
Thanks
Schm

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

Hex Color As Variable In Color Object?
im trying to do this

myColor = new Color(myMC);

myColor.setRGB(variable);

we have all of the colors we need in css info in a database but im attempting to use the same values in flash. i can load the variables in fine but when i try to set them as a hex color it just assumes the letters are hex colors.

any suggestions

Background Color With Color Object?
Hey guys, quick question, is there a way to control the background color of a flash movie using the color object or some other way? i would like the entire window (html background included) to change, so sticking a stage-size movieclip in the back wouldn't help. Thanks .

Get The Color To Change Another Obj Color
Im trying ro change a MC color from get the color of another MC color.
Please please help I think im going mad...........
Really appreciate.
Cheers Matt

Color Object- Get Color Name?
Hello,

I made a color picker and I was wondering if the color object had any way of grabbing the actual color name?

I know I could put all the colors into an array and call them up as needed... I've done the same thing in C#... and the color object in C# has a color name feature, I was wondering if Flash's color object had the same deal.

-Ryan

Change Color Of Button With Value Of Color Of Dynamic Button
I'm new to actionscripting so bear with me.

i have dynamically created several buttons with random colors. these are the source buttons from which to retrieve the color value.
i use another button as a destination button. When clicked it should change it's color to the color of a previous clicked button.
i use a global variable for storing the colorvalue. this colorvalue is used by the destination button so it will change in that color.

my problem is not to change the color of the destination button but to retrieve the color of the dynamically created source buttons. can anybody give ,me any pointers on how to do this correctly.

here's some code i am using. i've got this feeling it's a refferencing problem




//code which is under the source button
on(release)
{
butcol=new color();
_root.transfercolor=butcol.getrgb();
_root.givecolor(this);
}


//code for the dynamically created source buttons which i put in
//frame 1
var transfercolor;
for(var i=1;i<=10;i++)
{
duplicatemovieclip("button"+(i-1),"button"+i,i);
eval("button"+i)._y+=25;
butcolor=new color("button"+i);
butcolor.setrgb(math.floor(math.random()* 0xffffff));
}


//code under the destination button
on(release)
{
mycolour = _root.transfercolor;
butcolor=new color(_root.mainbutton);
butcolor.setrgb(mycolour);
_root.givecolor(this);
}

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?
}

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

Change Bg Color W/ AS?
Can you change the background color of a movie with actionScript?

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

Color Change
hey I need to know, how make this hot effect http://www.floetry.net when u change of sections change the movie propieties can u help me to do it??

Change Color
Hi all,

I have white t-shirt jpg which i imported into main stage.

I know how to change color.My problem is changing color it changes color of the whole shirt solid and cant see the stiching and folds of the material.

I used alpha 50% and then can see all the details but then the color is a blend of the white and what ever color I pick. Black comes out grey, dark blue comes out light blue.

Is there anyway to do it?

I dont want to load 20 jpgs of all the t-shirt colors.Just have one and user can change it using color chart.

thanks

Color Change?
Hi!
I'm fairly new with Flash, but i've been trying to build my own homepage with it for a couple of days now, but i just can't figure out how to make the color change on the textlinks when i put the mouse over it...

I'm sorry if you don't understand what i mean,
but i'm swedish so my inglish isn't so good.

Color Change Mc With As
Hi

I need some help...

I have a button that I want to tell a mc to change color on rollOver with action script. Can anybody help me?

Thanks

Change The Color
hey everybody, how would one change the color of a mc using action script??

and if thats not tough enough is it possible to change it to a linear color?

thanks for any help at all

Copyright © 2005-08 www.BigResource.com, All rights reserved