Gradient Color Change
I am trying to create a movie clip of a gradient square that gradient colors change smoothly. I have tried to use the shape tween and had no luck. i have also tried messing with alpha. any tips will be appreciated. thanks in advanced
FlashKit > Flash Help > Flash MX
Posted on: 10-19-2005, 05:36 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Change MovieClip RollOver Color(NOT Single Color, But Gradient) Dynamically ?
hi
I have created this for single color.But how to change when it is a gradient color.
for single color rollover code.
Code:
rollcolor = "0xFF0000";
normalcolor = "0x339900";
my_color = new Color(my_mc);
my_mc.onRollOver = function() {
my_color.setRGB(rollcolor);
};
my_mc.onRollOut = function() {
my_color.setRGB(normalcolor);
};
Thanks in advance
How To Change MovieClip RollOver Color(NOT Single Color, But Gradient) Dynamically ?
hi
I have created this for single color.But how to change when it is a gradient color.
for single color rollover code.
ActionScript Code:
rollcolor = "0xFF0000";
normalcolor = "0x339900";
my_color = new Color(my_mc);
my_mc.onRollOver = function() {
my_color.setRGB(rollcolor);
};
my_mc.onRollOut = function() {
my_color.setRGB(normalcolor);
};
Thanks in advance
BG Gradient Color Change
Code:
this.createEmptyMovieClip("port_bg",0);
clients.swapDepths (2)
port_bg._x = (0 - ((Stage.width - 800) / 2));
port_bg._y = (0 - ((Stage.height - 600) / 2));
var color1_mc = 0x4D7F5D;
var color2_mc = 0x223829;
var color3_mc = 0x152219;
var color4_mc = 0x0F1812;
var color1:Number = color1_mc;
var color2:Number = color2_mc;
var color3:Number = color3_mc;
var color4:Number = color4_mc;
ex = ((Stage.width / 2) - (Stage.height / 2) - 150)
var colors:Array = [color1, color2, color3, color4]; //LOCUMS
alphas = [100, 90, 80, 100];
matrix = {matrixType:"box", x:ex, y:0, w:Stage.height, h:Stage.height, r:0};
if (Stage.height < 900) {ratios = [25, 165, 255, 255];}
else {ratios = [25, 145, 220, 255];}
port_bg.lineStyle(0,0x000000,0);
port_bg.moveTo(0,0);
port_bg.beginGradientFill("radial", colors, alphas, ratios, matrix);
port_bg.lineTo(Stage.width,0);
port_bg.lineTo(Stage.width,Stage.height);
port_bg.lineTo(0,Stage.height);
port_bg.lineTo(0,0);
port_bg.endFill();
This is what I've done so far as a background for my liquid flash site. What I hope to do with it is for each page, I'd like to have a different set of colors for the gradient (and a smooth transition between the colors). I want it so that I can change the colors as I click the menu button for each page. I've been able to figure things out up to this point, but now I'm completely stuck.
Tried Ultrashock, tried Actionscript.org. I completely forgot about FlashKit. I sure hope someone knows how.
Any help would be appreciated.
Thanks in advance.
Gradient Color Change
Code:
this.createEmptyMovieClip("port_bg",0);
clients.swapDepths (2)
port_bg._x = (0 - ((Stage.width - 800) / 2));
port_bg._y = (0 - ((Stage.height - 600) / 2));
var color1_mc = 0x4D7F5D;
var color2_mc = 0x223829;
var color3_mc = 0x152219;
var color4_mc = 0x0F1812;
var color1:Number = color1_mc;
var color2:Number = color2_mc;
var color3:Number = color3_mc;
var color4:Number = color4_mc;
ex = ((Stage.width / 2) - (Stage.height / 2) - 150)
var colors:Array = [color1, color2, color3, color4]; //LOCUMS
alphas = [100, 90, 80, 100];
matrix = {matrixType:"box", x:ex, y:0, w:Stage.height, h:Stage.height, r:0};
if (Stage.height < 900) {ratios = [25, 165, 255, 255];}
else {ratios = [25, 145, 220, 255];}
port_bg.lineStyle(0,0x000000,0);
port_bg.moveTo(0,0);
port_bg.beginGradientFill("radial", colors, alphas, ratios, matrix);
port_bg.lineTo(Stage.width,0);
port_bg.lineTo(Stage.width,Stage.height);
port_bg.lineTo(0,Stage.height);
port_bg.lineTo(0,0);
port_bg.endFill();
This is what I've done so far as a background for my liquid flash site. What I hope to do with it is for each page, I'd like to have a different set of colors for the gradient (and a smooth transition between the colors). I've been able to figure things out up to this point, but now I'm completely stuck.
Any help would be appreciated.
Thanks in advance.
Gradient Color Change
Code:
this.createEmptyMovieClip("port_bg",0);
clients.swapDepths (2)
port_bg._x = (0 - ((Stage.width - 800) / 2));
port_bg._y = (0 - ((Stage.height - 600) / 2));
var color1_mc = 0x4D7F5D;
var color2_mc = 0x223829;
var color3_mc = 0x152219;
var color4_mc = 0x0F1812;
var color1:Number = color1_mc;
var color2:Number = color2_mc;
var color3:Number = color3_mc;
var color4:Number = color4_mc;
ex = ((Stage.width / 2) - (Stage.height / 2) - 150)
var colors:Array = [color1, color2, color3, color4]; //LOCUMS
alphas = [100, 90, 80, 100];
matrix = {matrixType:"box", x:ex, y:0, w:Stage.height, h:Stage.height, r:0};
if (Stage.height < 900) {ratios = [25, 165, 255, 255];}
else {ratios = [25, 145, 220, 255];}
port_bg.lineStyle(0,0x000000,0);
port_bg.moveTo(0,0);
port_bg.beginGradientFill("radial", colors, alphas, ratios, matrix);
port_bg.lineTo(Stage.width,0);
port_bg.lineTo(Stage.width,Stage.height);
port_bg.lineTo(0,Stage.height);
port_bg.lineTo(0,0);
port_bg.endFill();
This is what I've done so far as a background for my liquid flash site. What I hope to do with it is for each page, I'd like to have a different set of colors for the gradient (and a smooth transition between the colors). I've been able to figure things out up to this point, but now I'm completely stuck.
I'm also posting this in Flash 8 because I'm working on it, but if it is more appropriate in the Actionscript category, could a moderator kindly move it for me?
Any help would be appreciated.
Thanks in advance.
Color Like Flash Color+gradient
hi
i am creating a color filling flash in with i want to add colorpicker with gradient color also just like flash color picker .
i know simple colorpicker component implementation but i want gradient with it .Please Give some hint about it .
Thanks in advance
shobha1
Gradient Color Transformation
Ok yeah, we've all heard of changing colors, and fading things with actionscript, assuming that the object has only one color though! So! What do you do when you have a, ... I don't know a green sphere ... that has a gradient fill from green to a dirty brown green, and you want to use Actionscript to make copies of the same vector, but with a gradient that is slowly going from the green gradient to a red and dark red gradient?
I am sure it is possible by tinting the object, but I am not sure how to write the script myself ... still looking in the reference
Anyway, if you know any method(s) please post, thanks
Transparent Color In A Gradient
Can anyone tell me how to make a color transparent in a gradient in Flash. Assistace would be most appreciated.
TY in advance...
R
Preloader Gradient Color
Hi all,
I am building a preloader, everything works fine.
I want to make the preloader white when it first starts and fade to....blue when its at 100%
I have no idea where to put the code, or what the code is for that matter.
If someone has a few seconds to help, I would greatly appreciate it.
Thank you so much!
Gradient Color Manipulation
I have a shape with gradient color in it, from RED to BLUE.
Is it possible to change the gradient color using ActionScript ?
Thanks
3 Color Gradient Using Matrix
Im trying to create a simple 3 color gradient in a rectangle object.
It supposed to go from Green --> Yellow --> Red.
Here is the code I am using.. Can't figure out how to add that 3rd color.
Any help would be great! Thanks!
Lance
ActionScript Code:
import flash.geom.*
import flash.display.*
// SET THE VALUES FOR THE GRADIENT FILL
var fillType:String = GradientType.LINEAR;
var colors:Array = [0x00CC00, 0xFF0000];
var alphas:Array = [1, 1];
var ratios:Array = [0, 0];
var matr:Matrix = new Matrix();
var spreadMethod:String = SpreadMethod.PAD;
// DRAW THE 3 COLOR RECTANGLE
var square:Sprite = new Sprite();
square.graphics.beginGradientFill(fillType, colors, alphas, ratios, matr, spreadMethod);
square.graphics.drawRoundRect(100, 100, 90, 35, 10, 10);
square.graphics.endFill();
matr.createGradientBox(20, 20, 0, 0, 0);
addChild(square);
Color Gradient Transition
Hi,
Any thoughts why this doesn't work? What have i left out? I'd like to transition between two separate gradients each containing three colors. Something is wrong with this script i think.
ActionScript Code:
function animate(ratio) { // change the ratio position, limiting it between // 10 and 245... ratio.x += ratio.speed; if ((ratio.x>245) || (ratio.x<10)) { ratio.speed = -ratio.speed; } return ratio.x;}////// define the beginGradientFill parameters...matrix = {matrixType:"box", x:0, y:0, w:550, h:100, r:0};colors = [0x00CC66, 0xFFCC00, 0XCC3300];alphas = [100, 100, 100];ratios = [null, null, null];//// set our animated ratio points...ratio1 = {x:15, speed:.5};ratio2 = {x:240, speed:.5};ratio3 = {x:255, speed:.5};//// create our clip and give it an// onEnterFrame scripr to animate it...//_root.createEmptyMovieClip("clip", 0);clip.onEnterFrame = function() { // set new point positions ratio1.x = animate(ratio1); ratio2.x = animate(ratio2); ratio3.x = animate(ratio3); if (ratio1.x<ratio2.x<ratio3.x) { ratios = [ratio1.x, ratio2.x, ratio3.x]; } else { ratios = [ratio3.x, ratio2.x, ratio1.x]; } this.clear(); this.lineStyle(0, 0xff0000, 100); this.beginGradientFill("linear", colors, alphas, ratios, matrix); this.moveTo(0, 0); this.lineTo(550, 0); this.lineTo(550, 100); this.lineTo(0, 100); this.endFill();};
Color & Gradient Tutorials
Hi All!
I've recently wrote a color tool for ActionScript 3 (mojocolors).
I created two tutorials, one showing how to work with colors:
Color Tutorial
And one to show how to create nice gradients:
Gradient Tutorial
I hope some of you can use it and have fun with it. If you find errors or have questions, please post it here or drop me a mail.
thanks,
P.
Tip For Gradient Color Changer
(Note:-Here mc means Movie Clip and AS means Action Script)
Hi,
I am Omar and today I will ask as well as tell you a tip about for making Gradient color changer.
1. First Create a mc name it "chip" and make a shape of white color.
2. Then make another mc named "main" and put your chip mc in this mc. Select Chip mc and name it in instance panel "chip"
3. Now create a new layer named DGradient in main mc. Please align the chip mc in the center. Copy the shape of chip mc and paste it on DGradient layer. select the shape and in mixer panel select radial color. For first knob it must be of white color of 0 alpha and for second it must be black with 100 aplha.
4. Drag out the main mc to the stage and just paste the script
ActionScript Code:
onClipEvent (load) {
colour=new color(chip);
ColourTransform=new Object();
Delay=0;
}
onClipEvent (enterFrame) {
Delay=Delay+1;
if (Delay>=5) {
Delay=0;
Red=ColourTransform.ra=random(255);
Green=ColourTransform.ga=random(255);
Blue=ColourTransform.ba=random(255);
colour.setTransform(ColourTransform);
}
}
Please Tell me how you like it.. For Explanation of Code ,send me a PM
Use as it is name to work properly
Color Gradient Transition
Hi,
Any thoughts why this doesn't work? I'd like to have two gradients blending together very very slowly. This script doesn't seem to work though.
ActionScript:
function animate(ratio) {
// change the ratio position, limiting it between
// 10 and 245...
ratio.x += ratio.speed;
if ((ratio.x>245) || (ratio.x<10)) {
ratio.speed = -ratio.speed;
}
return ratio.x;
}
//
//
// define the beginGradientFill parameters...
matrix = {matrixType:"box", x:0, y:0, w:550, h:100, r:0};
colors = [0x00CC66, 0xFFCC00, 0XCC3300];
alphas = [100, 100, 100];
ratios = [null, null, null];
//
// set our animated ratio points...
ratio1 = {x:15, speed:.5};
ratio2 = {x:240, speed:.5};
ratio3 = {x:255, speed:.5};
//
// create our clip and give it an
// onEnterFrame scripr to animate it...
//
_root.createEmptyMovieClip("clip", 0);
clip.onEnterFrame = function() {
// set new point positions
ratio1.x = animate(ratio1);
ratio2.x = animate(ratio2);
ratio3.x = animate(ratio3);
if (ratio1.x<ratio2.x<ratio3.x) {
ratios = [ratio1.x, ratio2.x, ratio3.x];
} else {
ratios = [ratio3.x, ratio2.x, ratio1.x];
}
this.clear();
this.lineStyle(0, 0xff0000, 100);
this.beginGradientFill("linear", colors, alphas, ratios, matrix);
this.moveTo(0, 0);
this.lineTo(550, 0);
this.lineTo(550, 100);
this.lineTo(0, 100);
this.endFill();
};
Gradient Drawing API Color Picker
Hey,
Here is some code that I just thought I would share. Just paste it into a 550 x 125 pixel movie and it should work fine. Its all code driven and there are no "real" movieclips in it. Any suggestions would be appreciated on how to make it better.
Whats wrong with it? The only thing I could see is that the color doesn't exactly match up with the color the mouse is over. If anyone has any good ideas for that please pass it along. One thing I'd like to do is dynamically generate the colors array based on the distance of the mouseover gradient bar and color spectrum that are needed. Anyway, hope you enjoy.
Code:
//extend the movieclip class so its easier to set the RGB value of a clip - thanks to Robert Penner for this one.
MovieClip.prototype.setRGB = function(colorValue) {
new Color(this).setRGB(colorValue);
}
// create an empty clip to draw to
gradient_mc = createEmptyMovieClip("gradient", 4);
box_mc = createEmptyMovieClip("box", 3);
function drawGrad() {
gradient_mc.clear();
// define 6 colors
colors = [0xFF0000, 0xFFFF00, 0x00FF00, 0x00FFFF, 0x0000FF, 0xFF00FF];
// all of the colors should be opaque
alphas = [100, 100, 100, 100, 100, 100];
ratios = [0x0, 0x33, 0x66, 0x99, 0xCC, 0xFF];
// this takes the mouse position and gets the angle from the
// middle of the gradient as radians.
angle = 0;
// this is our matrix
matrix = {matrixType:"box", x:50, y:50, w:500, h:500, r:angle};
// put all that together in the beginGradientFill
gradient_mc.beginGradientFill("linear", colors, alphas, ratios, matrix);
// draw the bounding box
gradient_mc.lineStyle(1, 0xffffff, 100);
gradient_mc.moveTo(50, 50);
gradient_mc.lineTo(500, 50);
gradient_mc.lineTo(500, 65);
gradient_mc.lineTo(50, 65);
gradient_mc.lineTo(50, 50);
// close up the fill
gradient_mc.endFill();
updateAfterEvent();
}
function drawBox() {
//box_mc.lineStyle(1, 0xFFFFFF, 100); // we dont want an outline.
box_mc.beginFill(0x333333, 100);
box_mc.moveTo(0,0);
box_mc.lineTo(550, 0);
box_mc.lineTo(550, 125);
box_mc.lineTo(0, 125);
box_mc.lineTo(0,0);
box_mc.endFill();
}
function changeBackground() {
var colors = new Array("FF0000", "FF1100", "FF2200","FF3300","FF4400","FF5500","FF6600","FF7700","FF8800","FF9900","FFAA00","FFBB00","FFCC00","FFDD00","FFEE00","FFFF00", "EEFF00","DDFF00","CCFF00","BBFF00","AAFF00","99FF00","88FF00","77FF00","66FF00","55FF00","44FF00","33FF00","22FF00","11FF00","00FF00", "00FF11","00FF22","00FF33","00FF44","00FF55","00FF66","00FF77","00FF88","00FF99","00FFAA","00FFBB","00FFCC","00FFDD","00FFEE","00FFFF", "00EEFF","00DDFF","00CCFF","00BBFF","00AAFF","0099FF","0088FF","0077FF","0066FF","0055FF","0044FF","0033FF","0022FF","0011FF","0000FF", "1100FF","2200FF","3300FF","4400FF","5500FF","6600FF","7700FF","8800FF","9900FF","AA00FF","BB00FF","CC00FF","DD00FF","EE00FF","FF00FF");
//50 is the offset from the left edge of the movie to where the gradient bar begins. I derived 6 by dividing 450 (length of the gradient bar) by the length of the array, to distribute the color spectrum evenly. Obviously its not perfect but still looks cool.
if (Math.floor(_root._xmouse - 50) % 6 == 0) {
box_mc.setRGB("0x"+ colors[Math.floor(_root._xmouse - 50)/6]);
}
}
// call the functions
drawGrad();
drawBox();
gradient_mc.onRollOver = function() {
mouseOver = true;
changeBackground();
}
gradient_mc.onRollOut = function() {
mouseOver = false;
box_mc.setRGB("0x333333");
}
gradient_mc.onMouseMove = function() {
if (mouseOver) {
changeBackground();
}
}
Changing Gradient Color With Ascript
hi there -
i have a shape that has a gradient fill - i want o change this gradient color from blue to red with the click of a button
how would i do this?
thanks a lot!
Applying A Gradient Color Without A Form
Imagine a whant to do a spinning sphere. To do that I use a normal Oval form but then i whant to apply a gradient that goes from the inside left to the inside rigth of the sphere.......ok!
To have the effect i aplly a tweening motion to the gradient ( and an APLHA increasing and decreasing gradient)............. it´s like the reflection of a ligth that goes from left to rigth on the sphere.
The problem is:
i only can aplly a gradient color ( this gradient is like a ligth) to a form ( is that true?)
if so, when the gradient appear all is movement , the borders of the form were the gradient exist will be over the inside of the sfere , and that gives me a image (were the gradient is) over the sphere!!!!! (like 2 different images one over the other)
Is there a way to aplly just a gradient ( without a form ) witch can be like smood ON the sphere while it´s in motion, and giving us the inpression that the sphere is speening?
Thanks
Dynamic Color With Gradient Fill
Hi there,
I'm trying to figure out how to use dynamic colors within a gradient fill. This borrowed script works fine with hex colours, however when I use a dynamic field in there it doesn't take (line 2). It seems to not like the square brackets -the line style (a few lines down), has no problem taking the dynamic field. Any help would be appreciated..
Thanks
fillType = "linear";
colors = [_root.rollcolour,0x0000FF, 0x0000FF];
alphas = [75, 100, 25];
ratios = [50, 100, 200];
matrix = {matrixType:"box", x:200, y:150, w:150, h:100, r:0/180*Math.PI};
_root.lineStyle(0, _root.rollcolour, 100);
_root.beginGradientFill(fillType, colors, alphas, ratios, matrix);
_root.moveTo(200, 100);
_root.lineTo(350, 100);
_root.lineTo(350, 200);
_root.lineTo(200, 200);
_root.lineTo(200, 100);
_root.endFill();
Color Banding On A Large Gradient, How To Fix?
I am trying to get a nice clean simple gradient going accross my mc. Using this code:
Code:
var fillType:String = GradientType.LINEAR;
// Orange var colors:Array = [0xde892e, 0x9b560c];
var colors:Array = [0x263a3c, 0x1d2223];
var alphas:Array = [100, 100];
var ratios:Array = [0x00, 0xFF];
var matr:Matrix = new Matrix();
matr.createGradientBox(this.stage.stageWidth, this.stage.stageWidth, 1, 0, 0);
var spreadMethod:String = SpreadMethod.PAD;
this.graphics.beginGradientFill(fillType, colors, alphas, ratios, matr, spreadMethod);
this.graphics.drawRect(0, 0, this.stage.stageWidth, this.stage.stageHeight);
this.graphics.endFill();
It works fine, except it causes huge banding on a large canvas. It looks fine when i shrink the movie down so it compresses the bands.
So my question is simple, how can i reduce the banding? Is it simply because there are a limited number of colors in the hex color range? So when colors are close to each other, and spread cross a large area, there is no find gradient between the two? Because it looks fine if i go froma very light color to a very dark color.. but then it defeats the color range i want.
Read Color Gradient Informations?
Hi,
is it possible to read out the informations of a gradient fill from an existing movieclip (fillType:String, colors:Array, alphas:Array, ratios:Array, matrix:Object, [spreadMethod:String], [interpolationMethod:String], [focalPointRatio:Number]) ?
Thanks.
How Do I Delete The Gradient Color Tabs?
In the Color Mixer window while Linear fill or Radial fill is selected, a long, thin, horizontal gradient preview shows what your current gradient looks like. Upon this preview are sliders you can use to mix up your gradient, and add more colors.
How do I delete/remove these so that I can get rid of superfluous tabs and be left with only the original two?
Applying A Gradient Color Without A Form
Imagine a whant to do a spinning sphere. To do that I use a normal Oval form but then i whant to apply a gradient that goes from the inside left to the inside rigth of the sphere.......ok!
To have the effect i aplly a tweening motion to the gradient ( and an APLHA increasing and decreasing gradient)............. it´s like the reflection of a ligth that goes from left to rigth on the sphere.
The problem is:
i only can aplly a gradient color ( this gradient is like a ligth) to a form ( is that true?)
if so, when the gradient appear all is movement , the borders of the form were the gradient exist will be over the inside of the sfere , and that gives me a image (were the gradient is) over the sphere!!!!! (like 2 different images one over the other)
Is there a way to aplly just a gradient ( without a form ) witch can be like smood ON the sphere while it´s in motion, and giving us the inpression that the sphere is speening?
Thanks
Gradient Color Display Problems
Hello all,
My problem deals with the gradient colors and how they won't display correctly, or not at all. Here's my website:
http://lynnandjanuel.com (a work in progress, of course)
When you click on the different buttons it brings you to different screens. Each of those screens has different gradients behind the text. Now, when I edit those gradients in flash, they are displayed smoothly, with so much gradient-goodness. But, when I publish and upload the .fla, the gradients seem choppy on the display, and some have bizarre lines running through them. I want them to be sharp and smooth, like in the edit mode.
Can this be corrected in the Publish settings? Or is it a problem of computer performance, too many layers or too much data in the .swf, or all of the above? I do have a lot of garbage in the .fla that I haven't gotten around to deleting yet, but I'm not sure that would be the problem.
Any help is greatly appreciated.
Gradient Color Display Problems
Gradient Color Display Problems
Hello all,
My problem deals with the gradient colors and how they won't display correctly, or not at all. Here's my website:
http://lynnandjanuel.com (a work in progress, of course)
When you click on the different buttons it brings you to different screens. Each of those screens has different gradients behind the text. Now, when I edit those gradients in flash, they are displayed smoothly, with so much gradient-goodness. But, when I publish and upload the .fla, the gradients seem choppy on the display, and some have bizarre lines running through them. I want them to be sharp and smooth, like in the edit mode.
Can this be corrected in the Publish settings? Or is it a problem of computer performance, too many layers or too much data in the .swf, or all of the above? I do have a lot of garbage in the .fla that I haven't gotten around to deleting yet, but I'm not sure that would be the problem.
Any help is greatly appreciated.
Applying A Gradient Color Without A Form
Imagine a whant to do a spinning sphere. To do that I use a normal Oval form but then i whant to apply a gradient that goes from the inside left to the inside rigth of the sphere.......ok!
To have the effect i aplly a tweening motion to the gradient ( and an APLHA increasing and decreasing gradient)............. it´s like the reflection of a ligth that goes from left to rigth on the sphere.
The problem is:
i only can aplly a gradient color ( this gradient is like a ligth) to a form ( is that true?)
if so, when the gradient appear all is movement , the borders of the form were the gradient exist will be over the inside of the sfere , and that gives me a image (were the gradient is) over the sphere!!!!! (like 2 different images one over the other)
Is there a way to aplly just a gradient ( without a form ) witch can be like smood ON the sphere while it´s in motion, and giving us the inpression that the sphere is speening?
Thanks
Changing The Color Gradient Dynamically
i am in deep trouble as my bose gave me a problem to solve.I was asked to change the color of the bg dynamically(color in the sense, the gradient ) the shade of the bg shud increase as the value which is fetched from a text file increases.
i cud fetch the value from the text file & cud make the movieclip play dynamically according to the value but dont know how to change the bg color gradient.the problem is that we have objects in the movieclip and that shud not be changed & only the bg layer's color shud be changed. plzz help me come out of this problem
luv
Andrew
Color Fade Into Background Image (using A Gradient), Who Knows How
I have an image of a house that I want the color blue to 'fade' into the house.
In photoshop, I would do this using the eraser tool, and just erase using the background eraser tool.
In flash mx, since the image of the house is a symbol, I cant exactly use the method of erasing,or can I
I would assume I would have to use the gradient tool and go from the blue color to the background color (which the background would be the image of the house )
How would I do this .
Post back if this is not clear.
Thanks
Gradient Color Values Stored In Arrays ?
Hi,
A question about setting colors when using the mx drawing api.
I want to fill an array with color values with a script. I have no idea how ... maybe something like.???
col = the base color;
incr = the gradient increment.
colorArray=new Array();
for(j=0;j<100;j++){
colorArray[j]=col+=incr;
}
If I wanted to fill an array with color values from say blue to black how do I do this??
Shipstern
Color Fade Into Background Image (using A Gradient), Who Knows How
I have an image of a house that I want the color blue to 'fade' into the house.
In photoshop, I would do this using the eraser tool, and just erase using the background eraser tool.
In flash mx, since the image of the house is a symbol, I cant exactly use the method of erasing,or can I
I would assume I would have to use the gradient tool and go from the blue color to the background color (which the background would be the image of the house )
How would I do this .
Post back if this is not clear.
Thanks
Color Fade Into Background Image (using A Gradient), Who Knows How
I have an image of a house that I want the color blue to 'fade' into the house.
In photoshop, I would do this using the eraser tool, and just erase using the background eraser tool.
In flash mx, since the image of the house is a symbol, I cant exactly use the method of erasing,or can I
I would assume I would have to use the gradient tool and go from the blue color to the background color (which the background would be the image of the house )
How would I do this .
Post back if this is not clear.
Thanks
Color Differences Between Flash & Bg (photoshop) Gradient
I tried searching the forum for this one and came up with nothing. I used a gradient in photoshop for the background for a site i am building, my nav is in flash and i took the hex color value of the background from the top of the nav and the hex color value of the background from the bottom of the nav in the gradient so that my background in flash would match the design, however, when i put them together in dreamweaver, the background colors are off.
are colors rendered differently between flash and photoshop? is there any way to fix this aside from trial and error?
Change To Gradient Fill
how can I change the backfill of a movieclip of a solid backfill to a lineal backfill when I pressure a button
How To Change Gradient's Alpha?
Hello!
QUICK SUMMARY: I need to access/change gradient's alpha values during runtime through a click of a button/MovieClip. Below more accurate description of the problem.
I am new to as 3 and I have run into a problem with changing a gradient colour with a click of a button. I have looked different fag and tutorials to get as far as I am, but now I’m stuck.
I have created a scene where I have 3 squares apart from each other, but on the same y axis and when clicking them they move into different places( on x axis) according to predefined places by an Array. In between the squares I want to create lines that stay attached to the cubes even though they move. I have created one of these lines, which is a movie clip with fill inside the height of 1px and so far everything is ok.
Now here is the problem: I want the line that is between the squares to fade out from the side where the pressed square is. So in the beginning you have 3 squares with lines attaching them and when you press one of them, say square B, the lines that connect square B to square A and C will fade out from the side of the square B but not from the A and C sides. If you then press say square C, the lines will fade back up again and fade on the side of the square C.
So far I have just tried to make it work on one side between Square A and B. I have tried to replace alpha gradient parameter with variable ‘i’ and I have even managed to change the values of the i but they do not update the alpha channel of the gradient. (the way I calculate i ís still in a trial and error phase as it should give 1 when the line is less than 100 pixels width and 0 when over…say 250 and in between 1 and 10 when the line is in between 100 and 250 pixels.
So basically I would like to know how to access the alpha parameters of an object during runtime or some other way to create the same effect. Probably something that can be inserted in the enter frame event listner. It would be good if the alpha gradient would be transparent only if the gap between the squares is more than 100 pixels. The line should of course fade in the same manner as the squares move and not just jump from 1 to 0.
Eventually I want the square it self to fade out as well when pressed, if I can get the line work first that would be great. Any help is appreciated and if you have any comments on my way of scripting please do make suggestions how to make it better. If you need any other info do tell.
Here is the code that I have been working on. The three squares mentioned before are currently Movie clips named box1, box2 and box3.
Here is a link to see how it looks so far:
http://www.kolumbus.fi/nevalainen/test/test5.html
ActionScript Code:
var box1:MovieClip = new MovieClip();
addChild(box1)
box1.graphics.lineStyle();
box1.graphics.beginFill(0x009999);
box1.graphics.drawRect(0, 0, 100, 100);
box1.graphics.endFill();
box1.x = 200
box1.y = 200
var box2:MovieClip = new MovieClip();
addChild(box2)
box2.graphics.lineStyle();
box2.graphics.beginFill(0xCC9933);
box2.graphics.drawRect(0, 0, 100, 100);
box2.graphics.endFill();
box2.x = 400
box2.y = 200
var box3:MovieClip = new MovieClip();
addChild(box3)
box3.graphics.lineStyle();
box3.graphics.beginFill(0xCC6699);
box3.graphics.drawRect(0, 0, 100, 100);
box3.graphics.endFill();
box3.x = 600
box3.y = 200
MovieClip.prototype.scrollthis = function(x) {
var cX:Number = this.x;
var difX:Number = cX-x;
this.x = cX-(difX/7);
};
MovieClip.prototype.strechthis = function() {
var wis:Number = box1.x + 100;
var len:Number = box2.x;
this.width = len-wis;
};
var i:Number = new Number
var fillType:String = GradientType.LINEAR
var colors:Array = [0x000000, 0x000000]
var alphas:Array = [1, i]
var ratios:Array = [0, 255]
var line:MovieClip = new MovieClip();
addChild(line);
line.graphics.lineStyle();
line.graphics.beginGradientFill(fillType, colors, alphas, ratios );
line.graphics.drawRect(0, 0, 100, 1);
line.graphics.endFill();
line.x = (box1.x + box1.width)
line.y = box1.y + box1.height -1
var block1place:Array = [200, 500, 50, 0];
var block2place:Array = [400, 750, 500, 150];
var block3place:Array = [600, 900, 850, 500];
var ArrayIndex:Number=0;
var sprite:Sprite = new Sprite();
sprite.addEventListener(Event.ENTER_FRAME, enterFrame);
function enterFrame(event:Event) {
box1.scrollthis(block1place[ArrayIndex]);
box2.scrollthis(block2place[ArrayIndex]);
box3.scrollthis(block3place[ArrayIndex]);
line.scrollthis(block1place[ArrayIndex] + box1.width)
line.strechthis();
};
box1.addEventListener(MouseEvent.MOUSE_DOWN, MouseDownHandler1);
function MouseDownHandler1(Event:MouseEvent){
ArrayIndex = 1;
i=((((len-wis)/100)-1)/1.5);
trace('len - wis', len-wis)
trace('i', i)
trace((len-wis)>100)
};
box2.addEventListener(MouseEvent.MOUSE_DOWN, MouseDownHandler2);
function MouseDownHandler2(Event:MouseEvent){
ArrayIndex = 2;
i=((((len-wis)/100)-1)/1.5);
trace('len - wis', len-wis)
trace('i', i)
trace((len-wis)>100)
};
box3.addEventListener(MouseEvent.MOUSE_DOWN, MouseDownHandler3);
function MouseDownHandler3(Event:MouseEvent){
ArrayIndex = 3;
i=((((len-wis)/100)-1)/1.5);
trace('len - wis', len-wis)
trace('i', i)
trace((len-wis)>100)
}
------------------------------------------
Thank you!
Hex Color Code To Change Movie Clip Color
Hi all, Sorry real quick,
i've got a text box with the text with a hex code from a color picker which reads say "FF0000" how do i use that hex code(FF0000) to change a movie clips color.
simple (me stupid)....
thxs for any help
jon
Return MC To Original Color After Dynamic Color Change
How is it done? All I've seen on the web is how to change the color. Well how about going back. I'm talking about a MC with many colors. I can't just change back to a single hexadecimal color.
I can accomplish the change as it passes over a frame, but I can't get it to change back.
In the frame is this:
ActionScript Code:
cHurtColor = new Color(_root.compMC);cHurtColor.setRGB(0x00FF33);
Trying to keep this simple....
Return MC To Original Color After Dynamic Color Change
How is it done? All I've seen on the web is how to change the color. Well how about going back. I'm talking about a MC with many colors. I can't just change back to a single hexadecimal color.
I can accomplish the change as it passes over a frame, but I can't get it to change back.
In the frame is this:
ActionScript Code:
cHurtColor = new Color(_root.compMC);cHurtColor.setRGB(0x00FF33);
Trying to keep this simple....
How Do You Change The Direction Of A Gradient In A Shape?
This has always bugged me and I always use to import png images from Photoshop to get the effect I want of a gradient going at a different angle.
If I draw a square shape and apply a gradient colour that goes from white to black. I can only have it going in one direction, left to right. Is there any way to make it go at different angles? Like White to Black from the top to bottom of the square or any angle I like?
Button Change Color On Select, Then Change Back
I have 3 buttons, named but,but2,but3. What I want is if you click a button it changes color to show what page your on. But when you click a different button now that one is highlighted and the original one goes back to the original color. Here's the code.
but3.onPress = function () {
_root.createEmptyMovieClip("container", 1);
loadMovie("banner3.swf", "container");
container._x = 0;
container._y = 0 ;
I figure I have to add some kind of if statement?
}
[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
Random Color + Change Color With AS With Ease
HI,
I followed this tutorial , but I´d like to add something more but don´t know how.
I[d like to make the MC to load a random color, in a color range that I specify, like #000000, #FFFFFF and #111111.
Also, I want somew buttons to change between this colors, but with an ease transition.
How can I do this?
|