Gradually Changing The Color Of An Object
What I want to do is to transition the color of an object to a different color gradually. In other words, in frame 1 i have a light gray circle. In frame 30, I have a dark gray circle. I want to show a smooth transition from the light gray to the dark gray. Can this be done with a motion tween?
Adobe > Flash General Discussion
Posted on: 05/11/2007 11:42:24 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
MX. Changing Color Gradually
Hi I am using setRGB to change the color of a movieclip gradually from one color to another, instead of just switching from say yellow to red. But I can get it to work.
I am pretty familiar with acrionscript, but can't get this one right.
Any ideas?
Thanks,
Flipsideguy
Gradually Changing Height Of An Object.
Hi guys,
I'm creating a flash game for kids. The basic idea is you click on various objects and a thermometer shows how hot the object is. Now I have got as far as the thermometer changing height for each object but what I want is for the thermometer to gradually increase or decrease when you click on an object rather than jumping to the right temperature immediately.
I am looking for either code examples or a tutorial to solve this problem rather than an explanation of the logic involved as I have worked that out already.
Thanks in advance for your help.
PS I'm running MX04 Pro.
Changing An Object's Color
i have this old piece of code:
Code:
if (Number(charinline)<=Number(linelen)) {
duplicateMovieClip("/fx_" add fx add "_0", "char" add i, i);
set("/char" add i add "/letter/lettercolor:char", key);
setProperty("/cursor", _x, Number(startx)+Number(charinline*kerning)-20);
setProperty("/char" add i, _x, Number(startx)+Number(charinline*kerning));
setProperty("/char" add i, _y, Number(starty)+Number(linenum*linespace));
charinline = Number(charinline)+1;
i = Number(i)+1;
}
... which duplicates and places mc named "char[i]" on the stage based on predetermined _x & _y values, now i need to change the color of said mc. how can i do that? i've been trying to find a way but i gave up after 3 hours.
any help will be greatly appreciated
thanks much
- w
Changing Object Color With AS
hi I am trying to make a smooth color transition using AS2
the way I have now the mc changes colors just fine, but not smooth like when you use tween. I know there is a 'get Transform' function but I don't know how to apply maybe someone has an example??
Code:
function changeBG(col) {
var c = new Color(_root.bg);
c.setRGB(col);
}
changeBG(0xCC3366);
Can I Get Some Help With Changing The Color Of An Object?
I'm trying to make the following - I have 5 buttons corresponding to five sections in my Flash movie..I want to make it so, that when I click on a button it background color changes(to show that it was clicked and I'm in that section)...
The button is located inside a movieclip(not in the root timeline)...
For the purpose I converted the background of the button (which I want to change) to a movie clip, so I could use the "setRGB" command, but still I'm doing something wrong and nothing happens...
Can someone explain to me clearly the mechanism of changing the color of a movie clip?
Thanks in advance!
Changing The Color Of An Object
Hi
I want to make something like a children's paint book. The user will choose the color from a palette and when she clicks an object, that object will seem in that color.
Anyone knowing a tutorial about it, or any suggestions on how to accomplish this?
Thanks in advance
Changing The Color Of Clicked Object
Hi,
I'm looking for a way to change the color of the object that I click on. Something like a paint program where you first click to select the color and then click on the place which you want to color.
Thanks
Greg
Changing Instance Or Object Color
does anyone know of a script that will change an object color?
eg: I have a white box, on button1 press I want it to go blue, on button2 press it will go red etc.
so is it possible?
thanks if anyone can help! would be tops!
zanga
Changing The Color Of An Object At Every Execution
I have a problem:
I have one file, template.as, this file keeps color configuration to make changes of my site.
I would like to know if it is possible to change color of an object every time of execution (run time).
I am using setRGB() function to make these changes.
The variable that defines the template that will be used is loaded with loadVariablesNum() function.
My script works only when I compile my movie clip (generate .swf)
I want to change the colors without having to "compile" my movie every time.
If someone can help me with other functions or any other way to do this, I will be very grateful.
Thanks
Changing Color Of Imported Object
Hi,
i am trying to change color of imported swf file from another swf, let say i have a swf names fileparent and inside mc with instant name stage. in that stage i have some controls of color boxes i have imported another swf using AS on stage. imported swf have some layers with different objects of different colors i want to change color of every object separately. i dont know how to access that object inside imported swf.
just need to know the way to get inside imported object.
see an example here
http://www.bluecotton.com/studio.htm...175&garColor=1
thanks in advance
Changing Object Color Using ActionScript
First hello to everyone from a newbie
And now to the problem..i want to change color of an object via AS, which seems simple enough but stay with me. Id already seen http://www.kirupa.com/developer/actionscript/color.htm but here the object processed is made of multiple rectangles and my object cannot be really made of it. To be more precise, i want to create an image of an house and change it's color. I tried drawing it with lines, then making it a symbol and change it according to the tutorial but all i accomplished is changing the color of lines.
Anyone has another suggestion?
Thanks in advance
So Easy, I Can't Do It - Changing Object Color
I draw a circle on the stage.
I select it and save as symbol, i call it mc_circle and "export to action script" as my_mc_cirle
I cannot get the circle to change color using what I imagine should be a 1 liner. Very frustrated
my_mc_circle.setRGB(0x0000CC);
and
mc_circle.setRGP(0x0000CC);
are doing nothing??
Changing The Color Of An Object/movie Clip
I had an object that I wanted to be visible and invisible at my choosing... had to change it to a movie clip (this seems silly to me... you should be able to do it to objects)... but now I want to change the color of this movie clip object at the click of a color... how would I go about doing this... I tried this without success:
c=new Color(img_boy);
c.setRGB( 0x000000 );
Thank you
AS Gradually Modify Color
ok so I have MovieA, which loads MovieB.
MovieB wants to change the color of the first movie, slowly darkening it.
so I tried a for loop:
darkenBGColor = new Color(_level0.instance1.bg);
darkenCAColor = new Color(_level0.instance1.ca);
for(i = 100; i >= 50; i-1){
dark.ra = i;
dark.ga = i;
dark.ba = i;
darkenBGColor.setTransform(dark);
darkenCAColor.setTransform(dark);
}
but the change happens so fast that you can't even tell. Is there a way that I can slow this effect down so it looks like I have tweened the change in color over maybe 10 frames?
or if you think it can be more easily done in another manner, please let me know
Changing Colours With AC Gradually
hello,
what i need is this, i have as graphic which expands and contracts as the mouse moves over it. that works.. what i am trying to add is this..
when the mouse is at small size and not expanded, i want it to be blac and white, and when it expands, i want the colour to come in..
my animation is a button inside of a MC, the code on the button is this
<code>
on (rollOver) {
newscale = 130;
colorTransform = {rb:255, bb:255, gb:255}
}
on (rollOut) {
newscale = 100;
colorTransform = {rb:0, bb:0, gb:0}
}
on (release) {
getURL("http://www.mysite.com, "_self");
}
</code>
the ac on the MC is this
<code>
onClipEvent (load) {
newscale = 100;
MyColor = New color(this);
colorTransform = {rb:0, bb:0, gb:0}
}
onClipEvent (enterFrame) {
if (this._xscale > newscale) {
this._xscale -= 10;
this._yscale -= 10;
this.colorTransform.rb -= 100;
this.colorTransform.bb -= 100;
this.colorTransform.gb -= 100;
} else if (this._xscale < newscale) {
this._xscale += 10;
this._yscale += 10;
this.colorTransform.rb += 100;
this.colorTransform.bb += 100;
this.colorTransform.gb += 100;
}
}
</code>
Gradually Changing Text Colour.
Hi I want to use action script to dynamically change a text colour from say grey to red. The text cannot be flattend and the fade must be gradual on mouse over and back to normal on mouse out...
Any ideas, my actionion script is a bit beginner by the way...
Need To Gradually Change A Movie Clip Color...
hi guys.
can anyone help me out?
I need to gradually chande the color of a movie clip through the press of a button. I´m kind of a newbie, so if it is not much of a problem, please explain slowly...
best regards
Gradually Changing The Tint Of A Movie Clip
mornin guys...
hope u all had a fun weekend...
now, my question is, how can i make a movie clip gradually change colour...? its a scene which goes from day to night... so i'm looking to change the tint of the background movie clip so it gradually changes to a dark blue tint...
is this possible through actionscripting, i would rather script this than manually set a twean animation...
thank, RobbieD
Rotating An Object Gradually
I have created a clock face with a minute hand (called 'minuteHand'). When I click a button (btn_forward) the minute hand rotates clockwise by 6 degress to point at the first minute marker on the clock face. Each time the button is pressed, the hand rotates another 6 degrees. There is also a back button (btn_back) which does exactly the same only rotates the hand in the opposite direction. I want to make the hand rotate smoothly rather than jump straight to the 6 degrees position. I have tried a tween but this became incredibly complicated. So my question is: how can I rotate the minute hand by 6 degrees, and show the hand moving there?
My code for the forward button is below:
Code:
on(press){
_root.minuteHand._rotation += 6;
}
Gradually Increasing The Speed Of The Object Movement
Hai Dudes,
I am trying a new gallery like this http://www.amazon.com/ (In the middle of the page, the gallery would be appear, sometimes It won’t be appear. On that time please refresh the page again and again than you would see).
On that gallery, you will have two buttons like back and forward. If you click forward button the images rotating towards clock-wise and click back button images rotating towards anti clock-wise.
If you click any button(back /forward) the images are move their respective direction slowly. Otherwise if you click the button continuously(without release the button) you will see the rotating speed of the images will be gradually increased.
Now lets come to the point, I want to know how do move/rotate a particular object with gradually increasing speed.
Thanks for your understanding
velu
Changing Fill Color And Line Color Dynamicly And Seperately
Hi community,
In this case, I am going to load a swf with a looping animation colored in black and white only. I want to change the color of the animation dynamicly so that I could have different color at each time. Here is my code:
Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import flash.display.*;
import flash.net.URLRequest;
private function init():void{
myCan.addEventListener(Event.ENTER_FRAME,capMotion);
}
private function capMotion(event:Event):void{
var bmd1:BitmapData = new BitmapData(mySwf.width, mySwf.height, true, 0x00CCCCCC);
bmd1.draw(mySwf);
var bitmap1:Bitmap = new Bitmap(bmd1);
bitmap1.x = 0;
bitmap1.name="org";
if (map.getChildByName("org") != null){
map.removeChild(map.getChildByName("org"));
}
map.addChild(bitmap1);
var bmd2:BitmapData = new BitmapData(mySwf.width, mySwf.height, true, 0xFFFFFFFF);
var pt:Point = new Point(0, 0);
var rect:Rectangle = new Rectangle(0, 0, mySwf.width, mySwf.height);
var threshold:uint = 0xFF999999;
var color:uint = 0xFFFFFF00;
var maskColor:uint = 0x00FF0000;
bmd2.threshold(bmd1, rect, pt, ">=", threshold, color, maskColor, true);
var bmd3:BitmapData = new BitmapData(mySwf.width, mySwf.height, true, 0xFFFFFFFF);
threshold = 0xFF000000;
color = 0xFF00CCCC;
maskColor = 0xFFFFFF00;
bmd3.threshold(bmd2, rect, pt, "==", threshold, color, maskColor, true);
var bitmap2:Bitmap = new Bitmap(bmd3);
bitmap2.name="dup";
bitmap2.x = bitmap1.x + bitmap1.width + 10;
if (map.getChildByName("dup") != null){
map.removeChild(map.getChildByName("dup"));
}
map.addChild(bitmap2);
}
]]>
</mx:Script>
<mx:Canvas id="myCan" x="10" y="10" width="650" height="603">
<mx:SWFLoader id="mySwf" width="100" height="250" horizontalCenter="0" verticalCenter="-7.5" source="dance.swf" complete="init()" scaleContent="false" autoLoad="true"/>
<mx:Image x="61" y="320" width="550" height="152" id="map"/>
</mx:Canvas>
</mx:Application>
It works quite fine but I afraid that it's quite resource consuming using enterframe and bitmap drawing. Is there any better method?
Thanks for help.
How Would I Go Changing Lots Of Movieclips Color And Border Color Seperatly?
I am in the making of a isometric level editor, and I have about 15 movie clips with more to come.
I want to let people change the color of tiles to what they want from a list of colors, so how can I let them change the color of a tile dinamicly with actionscript so that it changes a tile's color while preserving changes of "shadows"?
I mean I have let's say a cube and to make it look 3D I need to change each face to make a feeling of 3D and not a flat one.
thanks.
Changing Color On RollOut Then Back To Color After 2 Seconds
I am using the code below to make a shape turn color using on rollOver, then on rollOut is changes to a differant color(blue), then I want it to change back to the first color(white), either on another rollover or I perfer to make it change back to the fist color after a 2 seconds,
on (rollOver) {
var colorful = new Color("_root.shapes");
colorful.setRGB(0x006699);
}
on (rollOut) {
var colorful = new Color("_root.shapes");
colorful.setRGB(0x006688);
I want to be able to rollOver change color, onRollOut Change color again, then back to the first static color after 2 seconds.
Anyhelp would be great Thanks
[CS3] Changing Color (and Opacity Of That Color) Of Movie Clip
Hi. I have a pretty large movie clip filled with pngs. It's a sprite for a game and I want to change it's color. The setRGB method works, but I can't figure out how to set the opacity of the color. I don't want to change the alpha of the movie clip itself, just the color I'm applying to it so that it's just a shade over the normal images.
Is there any way to do this?
Changing Stage Color When Changing From Scene
Hi,
I would like to change the color of my stage when I get in my next scene, is it possible?
So when people look to the movie Scene one should be black and scene 2 white. Don't tell me to put a big white square at the button of scene 2 coz when put it online I want all my window to change from color.
Thx
[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
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
[F8] Problem With Changing "Shape Fill Color" Color
Hi guys,
I am having some trouble trying to figure out how to change the Shape Fill Color for the corner which is currently in #FF6600.
Can someone advise me how I can access this attribute?
See files attached.
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 .
Color Changing
Hi all,
i created a movie clip, in it's time line i put the action to rotare random 360 degree, it is working fine, like that i need to change the color of this movie randomly (RGB values 255).
thanks a lot for your replay.
naushad
Changing The Color Of A MC
Ok I hope that I can explain what Im after. I would like to make the color of a MC change (Morph) to the next closest value. Like gradually changing. Not just from RED to GREEN but more like red to reder to redest to dark red and so on. I hope someone can help..
Changing The Color On MC
ok i have found a script that will change the color of the MC gradually. BUT, I want it to change the R from 0 -255 then stop and staret to change the G from 0 - 255 And so on. What I have now is setting all the VAR to change the RGB al at once. Here is the code.
onClipEvent(load) {
colorFace = new Color(this);
var cnRedStart = 50;
var cnGtreenStart = 115;
var cnBlueStart = 152;
var cnRedRange = 150;
var cnGreenRange = 116;
var cnBlueRange = 80;
var i = 0;
var ldir = 0;
_root.lPlaying = 1;
}
onClipEvent(enterFrame) {
if (_root.lPlaying) {
nRedSkin = cnRedStart+(i*.01)*cnRedRange;
nGreenSkin = cnGreenStart+(i*.01)*cnGreenRange;
nBlueSkin = cnBlueStart+(i*.01)*cnBlueRange;
i = (ldir==0 ? i+1 : i-1);
colorFace.setRGB(nRedSkin<<16 | nGreenSkin<<8 | nBlueSkin);
}
}
What I want is to controll the colors one at a time not all at once.
Changing Color, Please Help...
hi,
i have a movieclip that consists of two other movie clips. i'm trying to change the color of the one sub-movie clip(sub_mc1), when you clicked on the main movie clip. the color is being decided by a variable ( _root.color ). i tried this code but it dosen't work...
onClipEvent (mouseUp) {
c = new Color( this.sub_mc1);
c.setRGB( parseInt( _root.color, 16 ) );
}
but this code changes the main movie clip's color, but when you click enywhere (i want only on movie clip) :
onClipEvent (mouseUp) {
c = new Color( this );
c.setRGB( parseInt( _root.color, 16 ) );
}
what is wrong with the firs one ??? please help...
Please Help With IF, ELSE And COLOR Changing
Hi everybody,
I'm just trying to build an actionscript, which makes the following:
When I rollOver a button, a MC changes its color to RGB #666666. When I click on the button, the same MC changes its color to RGB #999999. Now I want to make the following: When I rollOut the button, the MC should change its color again: If the last setRGB is #666666, it has to change to #0066CC, if the last setRGB is #999999, it has to stay in #999999. I simply don't get, how this works. Until now, I've got the following script for the button:
on (rollOut) {
outColor = new Color(movie);
statusColor = Color(movie);
statusColor.getRGB();
if (statusColor = "0x999999") {
outColor.setRGB(0x999999);
} else {
outColor.setRGB(0x0066CC);
}
}
Please can anyone help me getting the right script?? Thanks a million in advance,
pyramid
Color Changing
I have downloaded several movies from the gallery to disect and inspect, and from my studies I've found a strange color problem. Whenever I change the color of a fill, I sometimes have trouble getting back to the original color. For instance: Image1 is an odd shade of dark gray. Image2 is the same color. I change Image 2 to white. Later, I select Image2 and click the color box to select a color, and I use the dropper tool to get the color from Image1. Then I click the fill tool onto white Image2 which becomes a color which is dark gray, but not quite as dark as the Image1 color. Anybody else seen this?
Changing The Color Of Mc
Hi all
I need help!
I have two mc`s on maintime line...one contains image(instanceic) and another a slider starting from 0-220 pixel (instance:slider).
I am trying to change the color of pic by dragging the
-------slider ranges are:-------------
dragable lentgh = 220 pixel
default position of slider = 110 pixel
when slider is dragged to 0, I would like to change the color of pic to total bluewhen slider is dragged to 255 then change the color of pic to total black
How do I do this? need your help and feedback
thanks
reverse
Changing BG Color
Sup yall..?
Do's any body know a script to change the background color of a movie on a release of a button??
Color Changing
when I use a shape tween to change the color of a object the object's shape changes slightly when it undergoes the change. how do i fix this? thanks.
Changing Color
Hello
I am having version 5 of Flash.I have kept a dragging bar for selecting values.I want the color of a movie clip to become dark as I drag the bar up.And I want the color to become light when I drag the bar down.What should I do to change the color.
Changing Mc's Color
is there an action to set ink color to a MC? Something like set alfa.
I want to make my Mc become green in a 50%
Color Not Changing ?
I have this code in my main timeline
PHP Code:
if (xPos == -1000) {
caption_txt.textColor = 0xFFFFFF;
} else if (xPos != -1000) {
caption_txt.textColor = 0x000000;
}
but it doesn't change the color of the text field accordingly.
Changing Color Of Mc?
I have a movie called card. I want to change the color when a different button hits it. The code I am using changes the mc once and then stops. A friend looked at the FLA and told me I have to write a path to the array-but that did not work -here is the code
cardColor = new Color(hand.card);
cardColorArray = ["0x342286", "0x00cc66", "0x996699", "0xFFFFFF", "0x000000", "0x000000" ];
if (top = [0]) {
cardColor.setRGB(cardColorArray[0]);
} else {
if (top = [1]){
cardColor.setRGB(cardColorArray[1]);
} else {
if (top = [2]) {
cardColor.setRGB(cardColorArray[2]);
} else {
if (top = [3]) {
cardColor.setRGB(cardColorArray[3]);
} else {
if (_top = [4]) {
cardColor.setRGB(cardColorArray[4]);
} else {
if (top = [5]) {
cardColor.setRGB(cardColorArray[5]);
}
}
}
}
}
}
In the same Mc I have a Var called top
On my main timeline I have an array that looks like this
top = ["A", "P", "C", "E", "P", "S"];
Thanks for the help
Color Changing A MC
Okay, I have a MC (mainbox) within which I placed this code:
Code:
onClipEvent (enterFrame){
myColor = new Color(_root.mainbox)
switch (_global.colour) {
case 1:
myColor.setRGB(0xA3A3D1);
break;
case 2:
myColor.setRGB(0x8787C2);
break;
case 3:
myColor.setRGB(0x5252A0);
break;
case 4:
myColor.setRGB(0x414183);
break;
case 5:
myColor.setRGB(0xEFEFF8);
}
}
This should work out that, if i set _global.colour to different values, the color of the box changes accordingly. Now, on my navbar I have a set of buttons, that have the coding that if their x position is at a certain point, then _global.colour = (1,2,3,4,5). Firstly I had it set that as soon as you click on a button the color changes, but that's not as professional. I would like it so that only when the button is finished its animation (slides left) that the color changes.
Thanks,
DaVuLf
|