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
ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)
Posted on: 02-24-2004, 07:40 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
[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 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 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 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];
Movie Clip + Color Object
Hi Friends,
I want to create multiple movie clips with different colors using the color object. I havent used color object yet. But in many tutorials I found while creating color object we have to specify the MC name like
myColor = new Color("MC_name");
But what if I have mulitple movieclips the number of which is going to be uncertain. Names of MC could be like MC0, MC1,....MCn. So that I can create a for loop or something and then can achieve it. But still cant getting through it. Pls can anyone HELP me out with this. Any suggessions would be thankfully appreciated.
Thanx again..
Ashish
Movie Clip + Color Object
Hi Friends,
I want to create multiple movie clips with different colors using the color object. I havent used color object yet. But in many tutorials I found while creating color object we have to specify the MC name like
myColor = new Color("MC_name");
But what if I have mulitple movieclips the number of which is going to be uncertain. Names of MC could be like MC0, MC1,....MCn. So that I can create a for loop or something and then can achieve it. But still cant getting through it. Pls can anyone HELP me out with this. Any suggessions would be thankfully appreciated.
Thanx again..
Ashish
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);
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.
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
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?
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 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.
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
[CS3][AS2] Hit Test On Object Inside Movie Clip To Object Outside Movie Clip.
I've got a movie clip inside a movie clip inside another movie clip, with this code on it:
onClipEvent(enterFrame){
if (this.hitTest(_root.climber)) {
_root.gotoAndStop(6);
}
}
climber is the instance name of a movie clip on the top level.
When I run the movie and the two objects touch, nothing happens, it stays on the same frame.
What am I doing wrong?
Changing Height Of Movie Clip Without Changing Width
Im using flash MX, and i needed to know if it was possible to change the height of a movie clip without changing the width of it. i have a 1px wide line, and i want to change the height of it, but i want to keep it 1px wide. is it possible to do this without having to redraw it everytime i want to change it?
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 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 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
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?
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
Load Movie And Change Color Movie Clip
Hello,
i wanna change color of mc. I have buttom Test and Parametri. In Test is movie testing.swf in Parametri you can change color of movie clips.
in file starttesting is make like this:
in layer1 is mcPlayer. In this mcPlayer are three layers, action, container and buttoms.
in action layer is this code:
Code:
mcButtonParametri.onRelease = function():Void{
addWindow("mcPar");
}
mcButtonFoto.onRelease = function():Void{
addMovie();
}
function addMovie():Void{
var mcLoader:MovieClipLoader= new MovieClipLoader();
mcLoader.loadClip("testing.swf",_root.player.container);
}
function addWindow(sLingage:String):Void{
var nIndex:Number = this.getNextHighestDepth();
var mcWindow:MovieClip = this.attachMovie(sLingage, "mcWindow"+nIndex, nIndex);
mcWindow._x= -50;
mcWindow._y= -100;
mcWindow.mcOkvir.onPress = function():Void{
this._parent.startDrag();
}
mcWindow.mcOkvir.onRelease = function() :Void{
this._parent.stopDrag();
}
mcWindow.mcClose.onRelease= function():Void{
this._parent.removeMovieClip();
}
}
That is all.
All you can see in attache file
My problem is:
How can I change color of mcOksid(testing.fla), but color will be change when i push a upload buttom? WHen i push reset buttom, the color will come back to default.
Second problem, in testing.fla in layer OKSID, i have mcOksid and mcOksid2.
Know if i change color of mcOksid to blue, mcOksid2 has to be blue too.
Please help
|