Color Tint With As?
Hello,
i'm changing colors of a movieclip using buttons with the color Tranform class however the new colors are 100% saturation over the clip.
how would i reduce the tint or hue level so that the details of the movie clip show through?
thanks
FlashKit > Flash Help > Flash Newbies
Posted on: 02-18-2007, 10:06 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Color Tint?
In the Flash IDE, it is really simple to tint a movieclip to the right color you want. Select the clip, set the color property to Tint and choose the percent of Tint Amount you want.
However, there seems to be no way to apply Tint Amount is AS3. I'm sure there is some way to do this through a complex formula of rgb offsets, but i can't figure it out. it blows my mind that this property exists in the IDE, but not actionscript.
Does anyone know a solution?
Get Tint Color From MC
I am tinting some MC items in my application using:
Code:
Color.prototype.setTint = function (r, g, b, amount) {
var trans = new Object();
trans.ra = trans.ga = trans.ba = 100 - amount;
var ratio = amount / 100;
trans.rb = r * ratio;
trans.gb = g * ratio;
trans.bb = b * ratio;
this.setTransform(trans);
}
When I rollover some of these MC I am adding a glow using:
Code:
var gf:GlowFilter = new GlowFilter(globalColor2, 100, 100, 100, 5, 3, false, false);
topLeft_mc.filters = [gf];
The tint colors of the MC can be different at different states and I would like the glow to work off color the MC is tinted.
How do I get the color I tinted the MC from the MC so I dont have to hardcode or track it?
Thanks for your help in advance!
GBY,
-R
How To Get Tint Color From MC
I am tinting some MC items in my application using:
ActionScript Code:
Color.prototype.setTint = function (r, g, b, amount) {
var trans = new Object();
trans.ra = trans.ga = trans.ba = 100 - amount;
var ratio = amount / 100;
trans.rb = r * ratio;
trans.gb = g * ratio;
trans.bb = b * ratio;
this.setTransform(trans);
}
When I rollover some of these MC I am adding a glow using:
ActionScript Code:
var gf:GlowFilter = new GlowFilter(globalColor2, 100, 100, 100, 5, 3, false, false);
topLeft_mc.filters = [gf];
The tint colors of the MC can be different at different states and I would like the glow to work off the color the MC is currently tinted.
How do I get the color I tinted the MC from the MC so I dont have to hardcode or track it?
Thanks for your help in advance!
GBY,
-R
Tint Color
I have a function that gets called by a tween class and I'm trying to change the tint of an object.
Code:
public function setNewTint( clip : Object, colorTo : uint, alphaColor : Number ) : void {
var newTransform:ColorTransform = new ColorTransform();
var newColor = newTransform.color = colorTo;
var tweenColor= Color.interpolateTransform(startColor, newColor, alphaColor);
clip.transform.colorTransform = tweenColor;
}
This throws an error TypeError: Error #1034: Type Coercion failed: cannot convert 16711680 to flash.geom.ColorTransform.
Anyone know how to solve this.
I also tried the below code but this acted strange. It worked but when I called the same function with a new color it jumped back to the original color before tweening to the new color. Its like it resets the clip back to its original tint state everytime you call it.
Code:
public function setNewTint( clip : Object, colorTo : uint, alphaColor : Number ) : void {
var ct:Color = new Color();
ct.setTint(colorTo, alphaColor);
clip.transform.colorTransform = ct;
}
Change Color/tint Of An Mc ?
hi.
i guess it's possible to change color/tint of an mc
with actionscript.
lets say i make a simple square as a Background, and i
want it to change color and fade between 3-4 different colors.
I can off course annimate this, but i dont want it to
be choppy, or increese the filesize much.
anybody ? please ?.....
Thanx
Color Or Tint Change
is there any way to change the color or tint of an mc with script like you can change transparency with _alpha?
How To Color The Tint Of A Movieclip Using As3
Hi...
I am trying to figure out how to color the tint of a movieclip using as3.
Using as2 I would do the following :
var clSymbol:Color = new Color(mcSymbol);
clSymbol.setRGB(0xFF0000);
..and the movieclip mcSymbol would turn red.
Very easy using as2 but I donīt know how to do the same thing using as3.
Any idea ?
thx
I Can't Seem To Set Tint Or Color Using Actionscript...
I need the contents of a movieclip to change color after clicking a button (to create a 'visited' look in a navigation).
Is there something equally simple as repositioning (which I just found out :-)) like MyMovieclip._x = 5; ?
I've found [B}setRGB[/b] but this doesn't seem to work and I understand that it's depricated? (I'm using Flash 8). So far I've been running around the web but I haven't been able to find anything like MyMovieClip.setTint = whatever.
Any tips / ideas?
Change Color/tint Of An Mc ?
hi.
i guess it's possible to change color/tint of an mc
with actionscript.
lets say i make a simple square as a Background, and i
want it to change color and fade between 3-4 different colors.
I can off course annimate this, but i dont want it to
be choppy, or increese the filesize much.
anybody ? please ?.....
Thanx
Actionscript Tint/color Change?
I took an image and broke it into a vector graphic, and i broke the 3 diffrent colors of the i'mage into 3 diffrent movieclips.
What I want to do is have a random color change that stays within a small boundary, I also want it to happen slowly like a tween.
I have never worked with color before.
Setting Color/Tint With ActionScript?
I need to set the color of a movieclip to red when a button is pressed, and I need to do this completely with actionscript. I can think of a few ways to do this, but I just wanted to know if there was something like:
this._r = 20;
this._g = 0;
this._b = 0;
or something similar. I need help as soon as possible ^_^
Thanks in advance.
Action Script Of Tint Of Color
I've got an image - I want to tint it 50% of a color over - a timeline lenght of 50 frames so it happens slow and smooth then I want to tint it back to the orginal color then tint it up 50% of another color and back down again - so on.
Is there an easier way then making all those frames?
will actionscript do the job.
I'm running Flash MX 2004 professional.
Thanks for your time and help.
JT
F8 Changing Color/tint At Intervals
Hi
I am looking for some advise to start my project in the right direction. I am using Flash 8 Professional and probably publish in F8.
Over the last month I have been playing and getting my head around AS2, expeciaily the transitions, easing etc.
I wish to create a project, where the main movie loads several smaller content movies at a level via navigation.
The site will be black and white orginally but I wish a background gradient movieclip, several text boxes, buttons etc to change color every 10-20 seconds. I know I can achieve this via the timeline but wish to create via AS2 as all my movement will be.
Would I be better trying to create a loop of colors and attach to the clips after setInterval, or using mx.transitions, or looking into getting my head around flash.geom.ColorTransform, or is there a better solution?
The main consideration is that some movieclips would require tinting at different values. I.e a gradient background may only need a 45% tint, where some text would require 100% others 75%. I would also need the loaded content color to match the main movie.
Could anyone point me in the right directions, or links to good tutorials. My AS skills are still quite limited, but wish to create something truely dynamic rather than a work around via the timeline.
Thanks for any assistance offered
Voddie
[F8] Action Script Color Tint
I was wondering how to do a tint funtion using the actionscript. What im looking for is to rollover a image and tint it to another color and when you roll off the image, it turns back to the original color of the image.
Color (tint) Object Inside MC
Is there a way that you can target an object in a MC and change the color throught actionscript? I'm using the animated button tutorial as a reference but I want to use the a different colored object for each button. Hope that makes sense.
Thanks.
Dynamic Color Change + Tint?
I have a shape whose color is changed when this button is pressed:
new Color([shape_selected]).setRGB(0xff0000);
I would also like this shape to have a rollover effect since eventually I'm going to have a ton of shapes and it will be hard to differentiate between them when selecting one. Tint seems to work the best visually, but I'm using this thing:
http://proto.layer51.com/d.aspx?f=143
and it resets the color of the shape back to what it was originally, so it undoes what the button does.
Any help? I would be pummmped! thanks!
Dynamic Color Change With Alpha On Tint
is it possible to apply a dynamic color change with alpha tint to an mc using actionscript, i would use this to chnage it normally:
code:
myColor = new Color(this);
myColor.setRGB(0xFFFFFF);
can this also incorporate tint so that i could specify an RGB and alpha value?
thanks.
Random Color Tint For Movie Clip?
Hello,
Is there not a way to do a setProperty for color of the whole clip? What I'm really trying to do is set a random color in a particle effect so the duplicated particles will be random different colors.
I've got it for size, alpha, etc, but how do I do color?
Thanks!
Change Color Tint Of Movie Clip
I would like to know how to change the color of a movieclip using actionscript. either on a specific frame or after pressing a button. oh! and it has to fade from one color to another
thanks!
Change Color Tint Of A Movie Clip
I would like to know how to change the color of a movieclip using actionscript. either on a specific frame or after pressing a button. oh! and it has to fade from one color to another
thanks!
Dynamic Color Change With Alpha On Tint
is it possible to apply a dynamic color change with alpha tint to an mc using actionscript, i would use this to chnage it normally:
ActionScript Code:
myColor = new Color(this);
myColor.setRGB(0xFFFFFF);
can this also incorporate tint so that i could specify an RGB and alpha value?
thanks.
Alpha/size/color/tint/scale/easing Tween Using Only AS.....
I have an MC with an instance name of "Scale". I would like to control a tweened effect with AS only. How do you do this?
For example: I would like when a button is pressed to have "Scale" fade away from 100% to 0% Alpha transparency. Also, if at all possible be able to control the easing.
Can someone share the probably when know secrets with me please..
Thanks
kitch
Tint
If I have a movie clip on stage, is it possible to apply TINT effect using Action Script ?
Thanks for your help
Mc Tint
I have a mc that I want to slowly tint on enterFrame. Can I do this with an action script?
Thank you
Tint In Swf
Hi everyone,
Im making an interactive program in which the user should be able to change the colout of a movieclip, is there anyway which i can put a scroll bar to edit the tint of the mc?
Thanks in advance
Matt
Tint
selectedGalleryBtn[selectedGalleryBtn.length - 1].alpha = 1;
Hi, How can I adapt this code so that it's tinted instead of alpha?
Thanks
Tint
var selectedGalleryBtn:Array = new Array();
addEventListener(Event.ENTER_FRAME, shadeGalleryBtn);
function shadeGalleryBtn(e:Event):void{
if(selectedGalleryBtn.length > 0){
selectedGalleryBtn[0].alpha = .6;
}
}
hi, i am trying to tint the selectedGalleryBtn instead of using alpha.
I can't seem to figure this out.
Thanks
Tint With AS
How can I script tinting?
I'm trying to script tinted into a movie clip.
I know about _alpha.. but I've never tinted with AS.
Hows it done?
I'm assuming its possible
Tint With AS
How can I script tinting?
I'm trying to script tinted into a movie clip.
I know about _alpha.. but I've never tinted with AS.
Hows it done?
I'm assuming its possible
Dynamic Tint
Hi, I am trying to change the color of a 3d rotating cube.
If I set tint to:
RGB:
255 255 0
Alpha
28%
I get the effect I want.
But, I would like to use code. I am using the following:
onClipEvent(load){
myColor = new Color(_root.CubeBase.CubeTop);
myColorTransform = new Object();
//percentage for the red component (-100 to 100)
myColorTransform.ra = 255;
//offset for the red component (-255 to 255)
myColorTransform.rb = 0;
//percentage for the green component (-100 to 100)
myColorTransform.ga = 255;
//offset for the green component (-255 to 255)
myColorTransform.gb = 0;
//percentage for the blue component (-100 to 100)
myColorTransform.ba = 0;
//offset for the blue component (-255 to 255)
myColorTransform.bb = 0;
//percentage for alpha (-100 to 100)
myColorTransform.aa = 28;
//offset for alpha (-255 to 255)
myColorTransform.ab = 0;
myColor.setTransform(myColorTransform);
}
The color is all flickery and the top bit does not look the same.
I understand that this may not be as clear as necessary, so you can see the difference here:
http://www.3ainteractive.com/temp/3ai.html
I would really like to be able to just set the tint settings dynamically...
M@)
Change Tint
Anyone know if its possible to change tint or advanced color selection through actionscript. i want to use different swatches
for each section of my site, but i dont want to have to make new
buttons.
Swap And Tint
how do you tint a symbol a certain color with certain percentage after a condition is proven to be true...
ex:
if ( variable == "red")
{
tint symbolA red 50%
}
AND
can you swap a symbol using actionscript???
like if i have a symbolA on the stage, but i want to swap it to symbolB, how would i do that using actionscript???
please help... either one of the question would be great...
Help With Changing TINT
Hope someone can help me out here.
I have created a button which will change the colour of my movieclip to red when pressed. However it changes it to full red, I just want to set it to 50% red (like if I had set the tint using properties panel and chosen red and set the slider to 50% - hope this makes sense!)
My button code looks like this...
on (press) {
carColor = new Color(carbody);
carColor.setRGB(0xff0000);
}
What do I have to add to change the percentage?
All help gratefully received!
Many thanks. Nick.
Alpha & Tint
Is there a 'simple' way to set the colour options of a movie clip through actionscript ?
Currently im using
Code:
_root.empty_mc._alpha = 15;
to set the alpha levels of a movieclip.
But id also like to tint colours within the clip in the same way as you can with a movieclip properties when placed manually on a scene.
Its possible by adding a movieclip with a block of colour above and then changing the alpha of that but is there a more simple way, actionscript way ?
thanks
Tint Vs Alpha?
This may have been asked here before but I have seen somewhere that using tint instead of alpha will produce a smaller file. Does anyone one know if it's true? I tried it with a very small file and both ways produced the same file size.
Rollover Tint
hey guys, i was wondering if sumone could tell me how to make it so that when the mouse is over mybutton it will slowly tint white up until about 45% and then stop and on roll out it will slowly fade back down. coz i seriously have no idea about this. i got the impression u had to use sumthing called setInterval but i dunno. any help would be appreciated.
Movieclip Tint..
Can anyone tell me how do i change the color(tint) of an mc with actionscript...
Thanks
Help With Image Tint...
Hey all, I've got this movieclip that I downloaded off of the site and I'm trying to add some code that would make the image thumbnails get brighter when you rollover them. (ideally, when clicked, I'd like them to stay bright until another thumbnail is pressed and then it fades back out, but let's start with just having it fade in?) I attached the gallery I'm trying to play with... the code is at the very bottom of the actionscript window. Any help would be awesome! thanks so much!
Change Tint
is it possible to create and tween a tint effect via AS. I have searched and found some posts saying yes and some no.
I have an image that tweens on and then tints to 50% white. On rollover i want this to go back to 0% (display the real image). Then onclick i will load a new .swf
Tint Flicker
Don't suppose anyone would know where I can find a script or a tute to make a movie clip flicker a certain colour then change to that colour. I tried using setRGB but it does not work across levels.
Any ideas?
Get Tint Using Actionscript
Hi,
I have set the tint on a movieclip but when I do...
Code:
trace(tintClip.transform.colorTransform);
or even...
Code:
trace(tintClip.transform);
it outputs 'undefined'.
Any ideas?
Tint Bitmapdata HELP
Hi,
i have a bitmap that is tiled to fill the background.
How would i 'tint' the tile gradually with the press of a button.
eg. entering a certain section of the site gradually changes the tile shade to another color so that you can still see the picture on the tile
This is the code for the filling that works fine
import flash.display.BitmapData;
Stage.scaleMode = "noScale"
Stage.align = "TL";
var tile:BitmapData = BitmapData.loadBitmap("tile");
function fillBG() {
this.beginBitmapFill(tile);
this.moveTo(0,0);
this.lineTo(Stage.width,0);
this.lineTo(Stage.width,Stage.height);
this.lineTo(0,Stage.height);
this.lineTo(0,0);
this.endFill();
}
fillBG();
var stageL:Object = new Object();
stageL.onResize = function() {
fillBG();
}
Stage.addListener(stageL);
stageL.onResize();
i've tried the
import flash.geom.ColorTransform;
and attached the bitmap to an MC and then used
tile.colorTransform(tile.rectangle, new ColorTransform(1, 0, 0, 1, 255, 0, 0, 0));
but this colors the whole tile completely where the pattern dissapears(and not gradually)
Any ideas
Thanks
Trinitee
Tint Scroll Bar? Please Help
Hi everyone,
Im making an interactive program in which the user should be able to change the colout of a movieclip, is there anyway which i can put a scroll bar to edit the tint of the mc?
Thanks in advance
Matt
Changing Tint With AS
probably just to tired to think and I really havnt needed to do this until now, but how do you change the tint of an MC via AS?
Tint Change With AS
Is it possible to change the tint of a movieclip using AS (probably by a button) - when the movieclip is not actually on the timeline at the time when the button is pressed?
IE The next time the movieclip is called for on the timeline it does not revert back to the default tint but keeps the tint value assigned by the button press.
many thanks for any input
Tint Percentage
hello all,
i have looked through the forums history but i can only find code that will help change the entire colour of the movieclip whereas i need it to have a tint percentage, you know just about 25 percent or so?
the code:
var my_color:Color = new Color(mc);
my_color.setRGB(10*124323);
aynone help?
sorry that ive just repeated a load of threads
[F8] SetRGB(), Is There A Way To Set % Of The Tint?
Greetings all.
I'm creating dynamic mcs, which also load .pngs. I want to put a color overlay on them, which can also be removed. (eg. they start off grey, and i want to put a green overlay, and then give the users the option to turn them back to grey... but the actual colors aren't really important)
If i have a standard mc already in my flv, i can obviously change the Tint to the color i want, and then also set the % so that it is just an overlay and not a solid color.
Is there a way to do this on dynamic mcs?
normally i use the code below to change the actual color:
myColor1 = new Color(furnClip_mc)
myColor1.setRGB(0xaaf09c);
but that makes the dynamic mc (furnClip_mc) totally green. How can i just make it say a 25% opacity?
TIA!
|