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




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



FlashKit > Flash Help > Flash Newbies
Posted on: 07-14-2008, 07:39 PM


View Complete Forum Thread with Replies

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

Changing The Color Of A Movie Clip?
Hello,

I am trying to use the code below, but it is not working.

new Color(Status).setRGB #FFFF89;

>>Status is a movieclip loacted on _root

Thanks for any help you can give.

Changing Movie Clip Color
Hi
I have some movie clips whose color I change depending on the information I retrieve from the database. This I'm doing it through ASP. The ASP file sends the movie clip name whose color has to be changed. I'm able to retrieve the movie clip name but the color of the movie clip is not changing. Given below is the action script.
Can anyone help me regarding this. Thanks in advance.
Gohan

---------------
Action Script:
--------------
this.onEnterFrame=function() {
sendDir=new LoadVars();
getDir=new LoadVars();
getDir.onLoad=function(){
c1=255;
c2=100;
c3=100;
rgb = (c1 << 16 | c2 << 8 | c3);
clr3=new Color(this.path); //path is the variable that is
//passed from ASP.
clr3.setRGB(rgb);

};
sendDir.sendAndLoad("http://localhost/testing/testNew.asp",getDir);
}

---------------
ASP Code
--------------
<%
dim sendDat
path=Session("getDir")
sendDat="path=" & path
Response.Write sendDat
%>

Changing The Color Of A Movie Clip
The actionscript I tried didn't seem to work for changing the color of the Movie Clip. I tried the following:

var my_color:Color = new Color(my_mc);
my_color.setRGB(0xFF0000);

I also tried this one as well:

var my_color:Color = new Color(my_mc);
var myColorTransform:Object = { ra: 50, rb: 244, ga: 40, gb: 112, ba: 12, bb: 90, aa: 40, ab: 70};
my_color.setTransform(myColorTransform);

Any help would be appreciated.

Thanks.

Changing The COLOR Of Txt In Movie Clip
hi,

there s movie clips works on rollover buttons and i have a problem that i cant change the colors of the txt .how will i change the YELLOW color of text to any color i like ?. can anyone help me pls ? i searched but there s no code for color..

here s the source :

http://rapidshare.de/files/33509591/...ed_buttons.fla

Changing Movie Clip's Color
Hi,
I have a movie clip on stage, & i want its color to change in the onRollOver event, any suggestions ?

Changing The Color Of A Movie Clip On The Maintimeline....?
Could someone please point me in the right direction...

I have a mc that contains sub-menu buttons...what I would like these buttons to do is : on release, change a mc in the maintime line a different color. Now, these mc's that contain the sub-menu buttons have also been placed in the maintime line......does any of this make sense? I'd appreciate any help...thanks!

Problem Changing The Color Of A Movie Clip
Hi all:

I have done an editable text field in order to let the user choose the background color of a movie clip. He can introduce the hexadecimal value.

In the first frame IŽve put the following:

------------------------
fonCol=new Color(fondo);
------------------------

"fondo" is the instance name of the movie clip that changes color.

The editable text field is called "colortext" so, IŽve created an invisible button (IŽll change this after it works) with the following code:

--------------------------------------
on (keyPress "<Enter>") {
fonCol.setRGB("0x"+colortext);
}
--------------------------------------

It doesnŽt seem to work, because when I enter FF0000 for example, the movie clip becomes black, and not red!!. Maybe the syntax is not properly written.

I need help, please.

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

Changing Color Of An Animated Movie Clip
It seems what I want to do should be pretty simple, but it is not working as I expect. I have an instance of a Movie Clip called myCircle and it is being animated with a Motion Tween. I want to change the color of myCircle by doing something like this:

circleColor = new Color(this.myCircle);
circleColor.setRGB (usersColor);
delete circleColor;

After the code executes, myCircle changes color, but it is no longer animated with the Motion Tween. Any suggestions?

Thanks

Changing Color Of A Nested Movie Clip
Ok, so I can change the color of a movie clip fine using actionscript. But say that my movie clip contains an outline and a color inside, and I only want the color inside to change. I figured I should separate the movieclip into two separate clips in order to to this. So now, I need to know how to changed the color of a nested clip.

circle consists of circleOut and circleFill movie clips

container.attachMovie("circle","circle1",1);
var circlefillcolor = new Color(container["circle1"]);
circlefillcolor.setRGB(0x333333);

This code will turn the whole circle including the outline gray.

container.attachMovie("circle","circle1",1);
var circlefillcolor = new Color(container["circle1"].circleFill);
circlefillcolor.setRGB(0x333333);

This code won't do anything color related.

I know I am doing it wrong but I don't know how to fix it. Any suggestions?







Attach Code

container.attachMovie("circle","circle1",1);
var circlefillcolor = new Color(container["circle1"].circleFill);
circlefillcolor.setRGB(0x333333);

























Edited: 02/08/2007 at 03:36:46 PM by Jurgamund

Changing Outline Color Of A Movie Clip
I have a movie clip representing the state of Missouri. I'm changing its fill color based on data from an xml file. I'd like its outline color to be black. I've tried applying a glow filter, but it doesn't seem to work. Can anyone tell me what I'm doing wrong?







Attach Code

var outline:GlowFilter = new GlowFilter();
outline.alpha = 1;
outline.color = 0x000000;
outline.blurX = 7;
outline.blurY = 7;
outline.inner = true;
outline.quality = BitmapFilterQuality.HIGH;
outline.strength = 255;

Missouri.filters = [outline];

Changing Instance Color Of A Movie Clip
I've got a map, of those you roll over the mouse on the sections and it displays the section name.
I want to add to these code, the instance of changing the colour of the section, so sections are more visible each time you move your mouse over the map.

So, I have this code on every section (each section is a MC).


Quote:




onClipEvent (mouseUp){
myColor.setRGB(0xff9933);
}
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
_root.ciudad.escribir("Quilmes");
tip = true;
} else if (tip) {
_root.ciudad.escribir("");
tip = false;
}
// end if
}




Somebody can help me out here on adding to these a change color?
I've tried several options but none of them worked.

Thanks a lot.

Changing Movie Clip Color Stops All Interaction
I have a symbol called myMovieClip that I've animated along a path. I have buttons that call play, stop, prevFrame, etc on the main timeline. This all works fine. However, when I click a button that calls...

on (release) {
trace("set color.");
c = new Color(myMovieClip)
c.setRGB(0x993399);
trace("done.");
}

...the movie clip changes color, but then the buttons don't work anymore. I can't even make it play by hitting the play button in the flash player. Anybody know what's going on? It should be way easier than this to change something's color.


thanks...
-sascha

Changing Outline Color Of Button Or Movie Clip
I have some vector art of the United States. I've made each state into a simple button. I'm changing the color of each button via transform.colorTransform. However, this knocks out the outline of each button. I can't "redraw" the button as a sprite because the states are not geometric shapes. I've tried applying a glowFilter, but instead of taking the color I specify (black or white), it uses the color of the colorTransform, which of course, doesn't show up unless I set the glowFilter knockout to true.

I tried changing a button to a movie clip, but that didn't make any difference.

Anyone know how I can either restore my vector outlines or set new ones on each U.S. state/button?

Here's a snippet of my code:

var t:Transform = btnName.transform;
var ct:ColorTransform = t.colorTransform;
ct.color = 0x3b6381;
btnName.transform.colorTransform = ct;

var outline:GlowFilter = new GlowFilter();
outline.alpha = 1;
outline.color = 0xffffff;
outline.blurX = 2;
outline.blurY = 2;
outline.inner = true;
outline.quality = BitmapFilterQuality.HIGH;
outline.strength = 255;

btnName.filters = [outline];

Changing Movie Clip Color ..whats Wrong With This Code?
Hi
I'm getting the movie clip name from access database through ASP which is a string. I have one frame in

my movie. The command txtTest.text= this.path is dispalying the retriebed value from teh database. So

data coming into the flash movie is not a prolem. So why is the movie clip color not changing?
Can anyone help me regarding this?
Thanks in advance.

------------------
Action Script
-----------------
stop();
this.onEnterFrame=function() {
sendDir=new LoadVars();
getDir=new LoadVars();

getDir.onLoad=function(){
myColor = new Color(this.path);
myColor.setRGB(0x006666);
txtTest.text= this.path;
};

sendDir.sendAndLoad("http://test/testNew.asp",getDir);

}

Changing Font Color Of Another Movie Clip's Dynamic Text (probably Ridiculously Easy)
Hi guys - I have two movie clips on the stage - KRS_ZOOM and heading_mc.

heading_mc contains a dynamic text box named ht. I am trying to change its font color via a frame on the KRS_ZOOM movie clip. how can i reference it?
My code below is not working.


tf = new TextFormat();
tf.color=0xFFFFFF;
trace(_root.heading_mc.ht.text);
_root.heading_mc.ht.setTextFormat(tf);

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

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

Changing Background Color During A Clip?
Hello,

I am trying to make swish file. I have made my letters drop on to the screen. But after that is done - I want to change the top half of the background color to red and the bottom half to yellow. I would like those to colors to slide in.

How should I go about doing this?

Thank you!

Tmuld.

Changing Movie Bg Color?
just wondering...is it possible to have the movie background color different somewhere along the movie than e.g. in the beginning?

Changing Movie Color For Backgrounds
im really stumped on this one,
I've been making an all flash website and i want to make a site control with a change background button.
the only way I knew how to do this is import my premade backgrounds and adding them to seperate frames in one layer and making a button and using the stop and goto actions.
this increased file size from 100k to 654k
so i thought why not just change the movie color itself,
is there way to do this that doent have such a bad effect on file size?

Changing Color Of Movie From Parent...
I seem to be unable to set the color of the movie pf_ from within the movie player_

the player_movie, reads info from an array and sets var's to set properties of the movie...well its meant to...player_ actions are as follows...

Code:
pn = this._name;
pxy = pn.slice(7, pn.length);
xy = pxy.split("");
x = (xy[0]);
y = (xy[1]);
var sex = set_sex(x, y);
var age = set_age(x, y);
var strength = set_strength(x, y);
var player = set_player(x, y);
if (player != 0) {
this._visible = true;
} else {
this._visible = false;
}
pc = set_color(player);
p_Color = new Color(this.pf_);
p_Color.setRGB(pc);
all of the functions are located in _root frame 1.

I want the tint of the movie pf_ to change depending on the value returned by set_player(x,y).

How would I send x,y to a child movie of player_ (pf_)? and how would I then use the x,y to ether change the tint of the movie ( not pref) or use the x,y to chane the frame of the movie (pf_) so I can set the color by using frames.

if you want to know what the final outcome for this project is plaese read frame 10 in _root for more info.
sorry if its a long winded one guys.

Changing BGround Color Mid-way Through Movie?
Other than just slapping a filled square on the bottom layer?

Changing Color In A Movie; Breaks Tween
Thanks in advance for any assistance.

I have created a very simple movie that consists of a 60-second timeline with B/W letter vector outlines that have motion and scale tween. Everything worked great, now the client wants to add color. I want now to add color to the outlines. But when I select the beginning and ending frames to apply color, the scale tween stops working. I do get an error message (yellow triangle) that it only works with groups, but each layer is grouped already. Any ideas?

Changing A Movie Background Color Via Txt File
Hi!

I've made a movie that load's different things (info) from a text file.

Now i'd like to be able to change the movie background color via txt file. So i could change the color code inside the txt file and the movie would show accordingly.

I'm sure there is an easy way .
(to ask is the easy way sorry)

Changing A Movie Clips Advanced Color
How do you change the values of the Advanced Color in actionscript?
Like to change the Alpha Colot you can use this
cloudsMain._alpha = 10;

Changing A Movie Clips Advanced Color
How do you change the values of the Advanced Color in actionscript?
Like to change the Alpha Colot you can use this
cloudsMain._alpha = 10;

Changing Color Of Moveclip Stopping The Movie
Hello all,

I know something similar to this has been posted but I can't seem to find the answer that will work for me.

I have a box_mc that moves around the stage. When it hits a specified frame I would like it to change colors based on an array.

What is happening is that it will move to the specified frame (frame 38) and change the color. It will not continue moving after that or reset back to the original color and position when the movie loops back to frame 1.

I have attached a zip with 2 fla files.... when with the box moving and no color change. The second with the box moving until the color changes.

Any help would be greatly appreciated.
Thanks in advance
jlmoshier

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

How To Create Moving, Fading And Changing Color Movie
Hi

I want to make a simple movie where a graphic shaped as a ! (exp. mark) randomly appears on canvas, fading in and out and changing colors. I have studied the tutorial but I need a little help. Can you help me?

How Can I Set The Background Color Of A Flash Movie To A Color Not In The Palette?
Hi,

I'm using Flash 5. I want to set the background color of my movie to a color that is not in the color palette. Is there a way for me to set to color to whatever I want using hexadecimal color codes?

Thanks,

Sam

Movie Clip Color
Hi I have ten movie clips that are all black.I am trying to set up a loop that would cycle through them turning them green then once all are turned green turn them back to black and repeat the process.I've tried with a set color transformcolor.But i just can't get it.

Color Value Of A Movie Clip
Hi all,

I am trying to get the rgb value of a movie clip and convert it to a hex value when I click on a button.

I have tried using the getRGB() function but can not get it to work.

Could someone please help me.

Thanks in advance.

Color A Movie Clip
I have a shape [made with pen tool] but i want it to remain transparent [i.e NO FILL]
i need code that will add fill !


colortransform and floodfill only change the outline of the shape [as it had no fill]
how do i add fill? and is there anyway to change fill without changing outline?

Movie Clip Color Change
I wanna be able to paint a theme according to a selected color (something like color matching application)
is there a way to control it with actionscript? I dont want to make photos for each color...

Give A Movie Clip A Color
Ho can i make a movie clip change to the hex color passed to it through a variable?

thanks in advance
cube77

Remove Color Value Off Movie Clip
Ok...i have now got the movieclips taking their colour from a variable, but when there is no value the movie clips default to black can this be changed for another color or removed so they resort back to the original movieclip image?


thanks

Change Movie Clip 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

Change Movie Clip 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

Can You Make A Movie Clip With No Color?
is it possible to make a rectangle movie box that has no fill color and no border color to load your swf's into?

Movie Clip Loses Color...
I'm working hard to get my mind around flash - and running into a few frustrations.

maybe someone can help?

i made an animation out of imported gifs from freehand - each piece was the same shape, but different colors - i put them all in their own layers and made a motion tween that gets them where they need to be - when i test the movie everything looks good (except that i can't seem to control the sped - even when i change the fps to 120 it's not any faster - does it matter that i have easement on?). But then i export the movie and it's all wrong - there's one letter of text that becomes transparent and all the shapes become transparent outlines.

so i tried to add the start button before exporting (making a new scene with the button and using an onrelease action to go to scene 2) but i can't get that to work (though it does work in the file i made where i simply imported the movie clip into the 2nd scene).

as you can see - i'm all confused. maybe someone can shed some light...

thanks

Color Picker And Movie Clip
Hello,

i have col. picker and movie clip and i wanna change color of that MC. My CP is from data components and i don't know how to do it.

example:

mycolor= new Color (picker)
mycolor setRGB(0x ???what??)

[MX] Apply CSS Color To Movie Clip
This is my setup right now:

I have a webpage that loads CSS styles randomly. I have 25 CSS styles they are all the same the only difference is the color of the Font and the color of the background.

The Random process is made with a verrrrrrrrrry simple Java script:

RandCSS()
function RandCSS() {
a = Math.round(Math.random() * 20 + 1)
if (a > 21) { RandCSS() } else { WriteCSS() }
}

function WriteCSS() {
document.write("<link rel="stylesheet" type="text/css" href="style" + a + ".css">")
}


Now... I'd like to take the color in the choosen CSS from the Javascript to be applied to flash elements.

For example i'd like to take the color of the Font to be applied to a Movie Clip into a Flash that is on that same webpage.

How can I extract the EXadecimal color code from the CSS loaded and parse it to the flash in my webpage?

And once in my webpage... How do i apply that Color code to my Movie Clip?

Thanks!

[MX] Apply CSS Color To Movie Clip
This is my setup right now:

I have a webpage that loads CSS styles randomly. I have 25 CSS styles they are all the same the only difference is the color of the Font and the color of the background.

The Random process is made with a verrrrrrrrrry simple Java script:

RandCSS()
function RandCSS() {
a = Math.round(Math.random() * 20 + 1)
if (a > 21) { RandCSS() } else { WriteCSS() }
}

function WriteCSS() {
document.write("<link rel="stylesheet" type="text/css" href="style" + a + ".css">")
}


Now... I'd like to take the color in the choosen CSS from the Javascript to be applied to flash elements.

For example i'd like to take the color of the Font to be applied to a Movie Clip into a Flash that is on that same webpage.

How can I extract the EXadecimal color code from the CSS loaded and parse it to the flash in my webpage?

And once the Exadecimal color code is in my flash... How do i apply that Color code to my Movie Clip?

Movie Clip Color Question
Hi I can change the color of a button within a movie clip by using the properties panel....my question is how do I use action script to specify the color?

Movie Clip Color Control?
is there a way to control two instance movieclip colors within one movieclip on the root timeline. When I apply the .RGB It applies the color to the whole movieclip. I want to control 2 different colors within the one Clip.

hope this makes sense..


Thanks...

Detecting The Color Of A Movie Clip.
Is there any way to use actionscript to detect the color of a movie clip? At first I thought it would be a standard movieclip property but I guess since most movie clips have multiple colors in them it isn't.

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