Change Color Then Apply Filter?
I have a simple circle movie clip in my library. The circle is green. I would like, at runtime, to change its color to blue, red, whatever. Then I want to apply a bevel filter to it. The problem is that after I apply the color, the filter is ignored. //First change color var changeColor = new Color(mcCircle); changeColor.setRGB(bitOnColor); //Then apply filter var innerBevel:BevelFilter = new flash.filters.BevelFilter(); var myFilters:Array = mcCircle.filters; myFilters.push(innerBevel); mcCircle.filters = myFilters;Clearly I'm missing the point here. Anyone know the right way to do this? Thanks very much.-jheske
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 08-30-2006, 06:18 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Bitmapdata, Apply Filter To One Channel? Realease A Filter
Hi there, I have two question:
Is it possible to apply a filter only to one channel or to access only one channel?
I've found somewhere:
Display.BitmapData.Channel.ALPHA
Is it something we can access at runtime?
When I appply a filter to a Bitmapdata, the Bitmapdata isn't really modified but just filtered, so if for example I copy one of its channel to another bitmapdata, I copy the source bitmap without the filter...
What I'd like to do is "release" the filter so it definetely modify the image. Is it a function to do so or can I only perform this by doing a screenshot of my MovieClip?
Thank you inadvance for your help.
Change Color Filter On RollOver?
Hi guys...
I saw this cool effect on a page at templatemonster.
I guess they have changed the Adjust color suration to about -50 and the brightness to about the same (-50).
Is it possible to change these numbers on rollOver so that they fade to 0 and 0?
Maybe with onEnterFrame? Example: (this is not correct only what i had in mind)
Text color red are wrong, i dont know what to write here. Thays why i need your help :P
Code:
image.onRollOver = function(){
image.onEnterFrame = function(){
image._fiter.adjustcolor.or.something +=5;
if (image._fiter.adjustcolor.or.something<=100){
delete image.onEnterFrame;
image._fiter.adjustcolor.or.something==100
}
}
}
image.onRollOut,releaseOutside = function(){
image.onEnterFrame = function(){
image._._fiter.adjustcolor.or.something -=5;
if (image._fiter.adjustcolor.or.something>=-50){
delete image.onEnterFrame;
image._fiter.adjustcolor.or.something==-50
}
}
}
The effect: Roll over images and see:
http://www.templatemonster.com/flash...tes/12125.html
How Do I Change Glow Color With This Filter AS 3.0 Script?
Here is what's going on... I've found the perfect script for what I need. I have my image set to my_mc as the title. Here' is what I have so far.
Can view it here, 18.1kb
http://www.mpiclub.org/vumpler/test.swf
Its got a beautiful red glow however I don't want a red glow lol. I just want a black glow and I can't find a glow color parameter or variable. I love the effect but I just don't know how to change the color. I know how to manually click on the image, go to filter glow and pick the color from the box but it gets ignored in this code. Can anyone please help? It's such a small thing and then I'm finally done with this website layout Thank you so much.
Code:
import flash.filters.GlowFilter;
var dir:Number = 1;
my_mc.blur = 10;
my_mc.filters = [new GlowFilter()];
my_mc.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
function enterFrameHandler(event:Event):void
{
my_mc.blur += dir;
if ((my_mc.blur >= 30) || (my_mc.blur <= 10)) {
dir *= -1;
}
var filter_array:Array = my_mc.filters;
filter_array[0].blurX = my_mc.blur;
filter_array[0].blurY = my_mc.blur;
my_mc.filters = filter_array;
}
How Do I Change Glow Color With This Filter AS 3.0 Script?
I am so close to being done with my logo. Here is what I have so far followed by the actionscript.
Its 18.1kb
http://www.mpiclub.org/vumpler/test.swf
Code:
import flash.filters.GlowFilter;
var dir:Number = 1;
my_mc.blur = 10;
my_mc.filters = [new GlowFilter()];
my_mc.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
function enterFrameHandler(event:Event):void
{
my_mc.blur += dir;
if ((my_mc.blur >= 30) || (my_mc.blur <= 10)) {
dir *= -1;
}
var filter_array:Array = my_mc.filters;
filter_array[0].blurX = my_mc.blur;
filter_array[0].blurY = my_mc.blur;
my_mc.filters = filter_array;
}
The glow is red, but I don't want it to be red at all. I want it to be a black glow. However everything I've tried doesn't seem to work. I know how to specify the glow color by just using the menu's but it doesn't effect the AS. Is there a code to change it to black?
[F8] Apply Filter To Mc Drawn With Api
Obvioulsy I'm blind.... WHY is't this code working...??!!!!!
Code:
import flash.filters.GlowFilter;
this.createEmptyMovieClip("mc_line",1);
with ("mc_line"){
lineStyle(20, 0xd1bca3,100);
_root.moveTo(0, 160);
_root.lineTo(Stage.width, 160);
// glow on the line
var glow:GlowFilter = new GlowFilter(0x003a68, 0.5, 0, 10, 5, 10,true);
var myTempFilters:Array = mc_line.filters;
myTempFilters.push(glow);
mc_line.filters = myTempFilters;
}
I've tried the glow-on-the-line part inside and outside the with statement.
The glow-on-the-line part works fine if I put an instance of a movie clip on the stage but not as above...
Why?!
I'd be greatful for a hint in the right direction...
Apply Filter @ Runtime
hi everybody.
I've got 4 dynamic TextFields inside a MovieClip.
on onRollOver I want to apply a DropShadowFilter to this MovieClip, and on onRollOut I want to remove the DropShadowFilter.
pretty simple task, I hope
..how do I do it?
here's my onRollOver and onRollOut-code:
ActionScript Code:
allContainer_mc.textHolder10.onRollOver = function(){
trace("onRollOver");
}
//
allContainer_mc.textHolder10.onRollOut = function(){
trace("onRollOut");
}
thanks
Apply Website Transition Filter?
Hey I'm new to AS , so I was wondering how would I go at attempting this?
On the website I'm building , I currently have it so when you click a link, it removes the current page and animates a new one, really simple, but how would I apply a filter transition? I downloaded a blur filter and installed it to flash cs3, so instead of just removing a page and motion tweening the new one, i would like to just do a motion blur tween between the current page, and the page clicked, how would I do that? This is my current code.
Should I upload the .fla file?
(EDIT) why wont it let me upload my code in CODE brackets? it gives me this error:
You have included 5 images in your message. You are limited to using 4 images so please go back and correct the problem and then continue again.
Apply Text Filter Dynamically
How can I add a glow filter to a textfield via actionscript? I know the procedure for doing the same thing with a movieclip, but the TextField class (and TextFormat) don't seem to accept filters as a property?
What I have so far:
ActionScript Code:
import flash.filters.*;var text_glow:GlowFilter = new GlowFilter(0xFF0000, 80, 10, 10, 100, 3, false, false);var some_txt:TextField;//Want to apply filter to text field
Unable To Apply Blur Filter
The code below fades three mc instances into each other. The movieclip instances are called, picture1_mc, picture2_mc,picture3_mc. They are based on three bitmap images that also sit in the library. I manually converted the original bitmaps into movieclips on the stage area. The fade code works fine, but what I would like to do is allow the user to
mouse click and cause a blur effect whilst the images are cycling along. My problem is that Im not sure how to apply this within my mousedown function. The applyFilter method seems to call for bitmaps but I'm dealing with movieclips. Thanks for any guidance
import flash.display.BitmapData;
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.filters.BlurFilter;
var filter2:BlurFilter = new BlurFilter(Math.ceil(Math.random()*5), Math.ceil(Math.random()*5), 3);
init = function () {
currentIndex = 1;
currentLayer = 1;
howLongToWait = 0;
_root.attachMovie("picture1_mc", "pic1", 0);
addNewPic();
};
addNewPic = function () {
clearInterval(myInterval);
if (currentIndex%3 != 0) {
currentIndex++;
} else {
currentIndex = 1;
}
newlyAdded_mc = _root.attachMovie("picture"+currentIndex+"_mc", "pic"+currentIndex, currentLayer++);
newlyAdded_mc._alpha = 0;
newlyAdded_mc.onEnterFrame = function() {
this._alpha += 2;
if (this._alpha>=100) {
this.onEnterFrame = null;
myInterval = setInterval(addNewPic, howLongToWait*100);
}
};
};
// run init()
init();
onMouseDown = function ()
{
//problems here!!!!!!!!!
var pointoint = new Point(_root._xmouse, _root._ymouse);
var rec:Rectange = new Rectangle(100,100,6,6);
//problem applying filter
//????.applyFilter(?????,rect,point,filter2)
};
myListener = new Object();
Mouse.addListener(myListener);
[AS3.0] Apply Filter To TextField Programmatically
Hi there!
I tried this using
Code:
textField.filters = [new GlowFilter()]
or just like in Flash8 passing the .filters array ref to another array and pushing filter to that array [was it?], but none of these steps worked.
Applying filter to Sprite, within which the TextField (_title) is contained:
Code:
var tit:Sprite = new Sprite();
tit.addChild(_title);
tit.filters = [new GlowFilter(0xFFFFFF,1,5,5,2,2)]
addChild(tit);
worked, however this method (using extra sprite for a textfield) is just too dirty, let alone we want to apply filters to multiple textfields..
Anyone knows how to apply filter directly to TextField instance in AS3.0?
Thanks!
Apply Filter To Just One Bitmap Data, No The Others?
Greetings,
I was following lee's tutorial on how to create advanced effects on bitmap data (like using the blur filter). I am not used to working with bitmap data and don't find it's creation and structure intuitive. Something I am not understanding is how to just blur a single clip and build the draw loop so that only that clips bitmap data gets drawn and blurred while other clips stay untouched. Any object I put onto the main timeline ends up bluring. I tried creative a sprite that contained the clip and then targeted that sprite, but still, any clip, or any object on the stage was blured and redrawn. Any help would be appreciated. Thanks!
Code:
import caurina.transitions.*;
var bmd:BitmapData = new BitmapData(550, 400, true, 0x000000);
var bm:Bitmap = new Bitmap(bmd);
var s:Sprite = new Sprite();
addChild(s);
s.addChild(bm);
var bf:BlurFilter = new BlurFilter(8, 8, 3);
var cmf: ColorMatrixFilter = new ColorMatrixFilter([1,0,0,0,0,
0,1,0,0,0,
0,0,1,0,0,
0,0,0,1,0]);
var logo:Logo = new Logo();
s.addChild(logo);
logo.scaleX = logo.scaleY = .14;
function mover(){
var myY:Number = Math.random()*stage.stageHeight;
var myTrans:String
myY <= logo.y ? myTrans = "easeOutExpo" : myTrans = "easeOutBounce";
Tweener.addTween(logo,{x:Math.random()*stage.stageWidth,
y:myY, time: 1,
rotation:Math.random()*300, onComplete:mover,
transition:myTrans});
}
mover();
addEventListener(Event.ENTER_FRAME, loop);
function loop(e:Event):void{
bmd.draw(s);
bmd.applyFilter(bmd, bmd.rect, new Point(0,0), bf);
bmd.applyFilter(bmd, bmd.rect, new Point(0,0), cmf);
bmd.scroll(0, -5);
}
Apply Animated Filter To An Image
I'm at war with this code for a week now .. I managed to get ripple effect, but it doesn't apply to image positioned behind. So I need some directions on how to achieve that.
Right now the image is steel and doesn't move with the ripples. Any help is appritieted
The code itself is in 2 classes, first is Ripples.as
Code:
package
{
import flash.display.Sprite;
import flash.events.*;
import RippleCanvas;
public class Ripples extends Sprite {
private var subobj:RippleCanvas;
public function Ripples() {
trace("Ripples Initialized");
var subobj = new RippleCanvas();
this.addChild(subobj);
}
}
}
And second is RippleCanvas.as
Code:
package
{
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;
import flash.events.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.display.BlendMode;
public class RippleCanvas extends Sprite
{
internal var sourceBmp:BitmapData;
internal var paintBmpData:BitmapData;
internal var paintBmpData2:BitmapData;
private var buffer:BitmapData;
private var paintBmp:Bitmap;
private var output:Bitmap;
private var brush:Sprite;
private var logo:Sprite;
private var filter:BitmapFilter;
private var filter2:BitmapFilter;
private var disp:BitmapFilter;
private var outputBmpData:BitmapData;
private var surface:BitmapData;
internal var pt = new Point(0,0);
internal var matrix1 = new Matrix();
public function RippleCanvas()
{
paintBmpData = new BitmapData(128, 98, false, 0x40);
//new image(166,240);
paintBmpData2 = new image(166,240);
//new BitmapData(128, 98, false, 0x40);
logo = new Sprite();
brush = new Sprite();
brush.graphics.beginFill(0xFFFFFF,1);
brush.graphics.drawCircle(0,0,4);
trace ("RIppleCanvas started..");
// surface = new BitmapData(128, 98, true, 0x000000);
surface=new image(166,240);
surface.blendMode = BlendMode.ADD;
surface.draw(logo);
sourceBmp=new image(166,240);
sourceBmp.blendMode = BlendMode.ADD;
// sourceBmp = new BitmapData(128, 98, false, 0x40);
buffer = paintBmpData.clone();
outputBmpData = new BitmapData(128, 98, false, 0x40);
//new image(166,240);
scaleX = 8.0;
scaleY = 8.0;
this.addEventListener(MouseEvent.MOUSE_DOWN, this.downEvent, false, 0, true);
this.addEventListener(MouseEvent.MOUSE_UP, this.upEvent, false, 0, true);
this.addEventListener(Event.ENTER_FRAME, this.update, false, 0, true);
paintBmp = new Bitmap(paintBmpData);
var cmat:Array = [ 1, 1, 1,1, 1, 1, 1, 1, 1 ] ;
filter = new ConvolutionFilter(3, 3, cmat, 9, 0);
filter2 = new BlurFilter(4,4);
output = new Bitmap(outputBmpData);
// output.blendMode = BlendMode.ADD;
// paintBmp.blendMode = BlendMode.ADD;
addChild(output);
addChild(paintBmp);
//var tf = new TextField();
//tf.text = "testing123";
//addChild(tf);
disp = new DisplacementMapFilter(paintBmpData2, new Point(), 4, 4, 48, 48, DisplacementMapFilterMode.IGNORE );
this.filters = new Array(new BlurFilter(16, 16));
this.blendMode = BlendMode.ADD;
}
function update(e:Event)
{
if(parent!=null){
var localPt:Point = parent.globalToLocal(new Point(parent.mouseX*0.125, parent.mouseY*0.125));
var m:Matrix = new Matrix();
m.translate(localPt.x, localPt.y);
sourceBmp.draw(brush, m, null, 'invert');
}
trace (localPt);
paintBmpData.applyFilter(sourceBmp, paintBmpData.rect, pt, filter);
paintBmpData.draw(paintBmpData, matrix1, null, 'add');
paintBmpData.draw(buffer, matrix1, null, 'difference');
paintBmpData.draw(paintBmpData, matrix1, new ColorTransform(0, 0, 0.98609374, 1, 0, 0, 2, 0));
paintBmpData2.draw(paintBmpData, matrix1);
outputBmpData.applyFilter(surface, outputBmpData.rect, pt, disp);
buffer = sourceBmp;
sourceBmp = paintBmpData.clone();
}
public function downEvent(e:Event)
{
if(e.stageX == 0 && e.stageY == 0)
return;
var curPt:Point = parent.globalToLocal(new Point(e.stageX, e.stageY));
e.stopPropagation();
}
public function upEvent(e:Event)
{
e.stopPropagation();
}
}
}
Code itself is in a mess right now as I tryed every single combination, without any success.. so plz help
How To Apply Blur Filter On Image In Different Layer?
I have one load which loads image randomly from external folder.
and another layer which has 5 columns. I wish to do a mouse over thing and one of the column will become blur.
I tried to use the blur filter, but can't seem to get it work on image that loads randomly from external folder.
this is the action script code I used for loading external images:
Quote: pic_arr = ["images/1", "images/2", "images/3", "images/4", "images/5"];
onLoad = function() {
ranNum = Math.floor(Math.random()*pic_arr.length);
holder_mc.loadMovie(pic_arr[ranNum]+".jpg");
};
any help?
Unable To Apply Blur Filter On Mouse Down Event
The code below fades three mc instances into each other. The movieclip instances are called, picture1_mc, picture2_mc, picture3_mc. They are based on three bitmap images that also sit in the library. I manually converted the original bitmaps into movieclips on the stage area. The fade code works fine, but what I would like to do is allow the user to
mouse click and cause a blur effect whilst the images are cycling along. My problem is that Im not sure how to apply this within my mousedown function. The applyFilter method seems to call for bitmaps but I'm dealing with movieclips. Thanks for any guidance
import flash.display.BitmapData;
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.filters.BlurFilter;
var filter2:BlurFilter = new BlurFilter(Math.ceil(Math.random()*5), Math.ceil(Math.random()*5), 3);
init = function () {
currentIndex = 1;
currentLayer = 1;
howLongToWait = 0;
_root.attachMovie("picture1_mc", "pic1", 0);
addNewPic();
};
addNewPic = function () {
clearInterval(myInterval);
if (currentIndex%3 != 0) {
currentIndex++;
} else {
currentIndex = 1;
}
newlyAdded_mc = _root.attachMovie("picture"+currentIndex+"_mc", "pic"+currentIndex, currentLayer++);
newlyAdded_mc._alpha = 0;
newlyAdded_mc.onEnterFrame = function() {
this._alpha += 2;
if (this._alpha>=100) {
this.onEnterFrame = null;
myInterval = setInterval(addNewPic, howLongToWait*100);
}
};
};
// run init()
init();
onMouseDown = function ()
{
//problems here!!!!!!!!!
var point:Point = new Point(_root._xmouse, _root._ymouse);
var rec:Rectange = new Rectangle(100,100,6,6);
//problem applying filter
//????.applyFilter(?????,rect,point,filter2)
};
myListener = new Object();
Mouse.addListener(myListener);
Apply Glow Filter On Target MC While Dragging An Object And Rolling Over The Target
I can get my filter to apply to a movie clip if i simply rollover or roll out of it. When the mouse rolls out, the filter is set to undefined. The problem I am having is that I want the object that is in effect the hit area to glow (have a filter applied) when the draggable object is being dragged over it.
This would make is easier for the user to visually identify that where they are currently hovering over, whilst dragging, is the area that they should drop the object.
Part of my code looks like this
Code:
this.onRollOver = function () {
if(_global.isDragging == 1){
this.filters = glowFilterArray;
}
}
this.onRollOut = function () {
_global.isDragging = 0;
this.filters = undefined;
}
_global.isDragging is set to 1 at the onPress stage, when startDrag occurs.
_global.isDraggin is set to 0 onRelease of the draggable object.
Are there any ideas for a solution?
Apply Color To Sprite
Hi,
I want to apply color to sprite. Sprite contains images.
Please suggest me the way to apply color to sprite.
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 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?
Adjust Color Filter
Hello all. I know you can control filters dynamically in Flash 8 (such as DropShadow, Blur, etc.). I can't find a way to control the Adjust Color filter dynamically though. Anyone know how to do this?
Adjust Color Filter
Why can't it be adjusted with actionscript like the others? If you can, how?!
Filter Color Doesnt Do What I Want.
Hello kirupians
I have a vector drawn thingy in my flash movie wich has a filter on it (dropshadow, color black).
Now I made that vector thingy tween and give it trough the tween another "tint"(white).
But the "filter" also change color and doesnt look the way I want it to be(it turns also white).
How can I prevent this ?
thx for reading
Adjust Color Filter Programmatically?
I can't find a way to apply the Adjust Color filter(s) programmatically. All the other filters, ie. Drop Shadow, Glow, etc., are in the flash.filters package, but Adjust Color isn't one of them. I mainly want to adjust the Saturation and Hue of a movie clip. Does anyone know if there is a way to do this via actionscript?
Thanks for any help!
Adjust Color Filter And Masking
I am trying to create a flash transition like seen here
http://www.loewshotels.com/en/default.aspx
I was wondering how I would go about doing this? I am trying to create a mask with having the filter for brightness and contrast to create the same effect? Do you know how to go about doing this?
If I am in the wrong place will someone let me know where I should go ask? That would be helpful thanks :)
Thanks
Edited: 05/22/2007 at 01:34:31 PM by heyitsme1983
Code Based Color Adjust Filter?
I have a symbol on the stage; it contains a bitmap with many colors but primarily blue. I want to get the same effect as if I used the color adjust filter on it. ie, color shift the whole symbol lets say to look green, but still keep all the detail.
How would I do that in as3?
Thank you much!
ColorMatrixFilter And Mc.filter=[color] Messing My Class
Hello guys…
This is killing me….
I really don’t have words to explain this problem…
First I import one of my classes (toGray), that class imports other 3 classes (flash.filters.ColorMatrixFilter, mx.transitions.Tween, mx.transitions.easing. *) With this class I can change the mc from color to white/ black.
Then on the Stage I have one button that change the color to gray and then I just want to apply a simple tween…
But now my btn is blinking when I rollover on it. When I say ‘blinking’ it means that the btn disappear and appears in just some milliseconds without leaving me to rollOver my btn.
It’s weird and I thought that I was overriding some function or variable but no I have read my code and modified like 20 times… and the only problem I found was on the Tween from the class.
If I delete this last line inside the onMotionChanged then everything works perfectly.
ActionScript Code:
myclass.target_mc.filters = new Array (colorMat)
what tha… the ‘filters’ is messing with my tween and my class
the function from the class:
ActionScript Code:
function render (sec : Number, dir : Boolean) { direccion = (dir == undefined) ? direccion : dir; var myclass = this var from : Number; var to : Number; if (direccion == false) { from = 100 to = 0 } else { from = 0 to = 100 } twnGray = new Tween (obj, "percent",null, from, to, sec || 1, true); twnGray.onMotionChanged = function () { var temp : Array = [] for (var i : Number = 0; i < 2; i ++) { temp [i] = myclass.matOriginal [i] + (myclass.dif [i] * myclass.obj.percent); } for (i = 0; i < myclass.willBeChanged.length; i ++) { if (myclass.willBeChanged [i] == 1) { myclass.matgray [i] = temp [0] } else if (myclass.willBeChanged [i] == 0) { myclass.matgray [i] = temp [1] } else { myclass.matgray [i] = myclass.matOriginal [i] } } myclass.currentState = myclass.willBeChanged [0] trace (getTimer()) var colorMat = new ColorMatrixFilter (myclass.matgray);///if i delete the next line everything will work. myclass.target_mc.filters = new Array (colorMat); } twnGray.onMotionFinished = function () { myclass.onGrayFinished () } }
:S
So anybody knows why when I apply the filter everything goes wrong?
Please help… I’m getting bold and now my class looks very bad
Thanks
Pepe
Able To Change Tint, Need To Apply Transistion Time To Tween
I have a button click making a tint (color) change happen, but it's so sudden, i'd like to have it take a second to tween between the colors. here's what i have:
1st frame:
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);}
then after someone clicks a button and sets choice as '0'...
if (choice == 0) {
myColor = new Color(moviec);
myColor.setTint(143,167,137, 20);
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
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....
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?
Drag Color And Change Objects Color
i looked at the kirupa's paint tutorial and it really didn't achieve the effect that i'm going for. i'm new to actionscript so i can't figure it out for myself, so i'm hoping someone can shed some light on the situation for me.
here is the setup: i have an object that i rendered in 3d studio max. will just call it a box. i have rendered that box in 3 different colors. red, yellow, and blue. i saved them each individually as targa files and imported them into flash. i created a movie with 3 frames. frame one contains the red box image, frame 2 contains the yellow box, and frame 3 contains the blue box. each frame has the stop command applied to it.
now on the main timeline, i have 3 different circles that have been converted to buttons each colored red, yellow and blue. now i can use a "tellTarget" type action to make the playhead on the box movie clip to jump to the corresponding colored circle that was clicked, but i'd rather let the user be able to drag the colored circle to that box, release, and change the box to the color that corresponds to that circle. i don't know if that requires some type of collision detection script or not. the box has no background so all there is, is the box itself so collision detection should just detect the box itself...right??
i would appreciate any insight that you could give me!!! if need be, i can supply a *.fla file for you to look at.
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?
Using A Color Chooser To Change Color Of MC
Hi,
I'm using a component which allows you to change the color of MCs but I can't get it to work...newbie sorry...
I have an MC on the stage with the instance main_mc which contains another MC called back_mc as well as a Mc (button_mc) which contains the component on frame 2 (ColorChooser) with this script :
code:
stop();
var myCol:Color = new Color(back_mc);
ColorChooser .changeHandler = function() {
myCol.setRGB(main_mc.back_mc.value);
};
Sorry if this is all very confusing...a path issue probably but I can't figure it out. Could someone help me please?
G
Color Change (heavy Change)
Hey everybody,
i dont know if this is possible, but it sure would be nice! I need to change all the elements in my movie that have the color X and change their color to color Y.
Is it possible to have this in AS? like, if i press one button all the elements that have the color black (graphic, text, background, etc) change their color to yellow?
thanks for any thoughts!!
cheers
Colormatrix Filter And Blur Filter Tween
Last edited by sks447 : 2006-10-17 at 15:11.
I want to have a picture fade from blurry and grayscale to sharp and colorized. I have the blur to sharp part working ok. I have the grayscale to color to working ok. The only thing is the filters dont work together. Ive tried to push one into another with no luck yet. You can see the comments in the code below. Thanks.
ActionScript Code:
function blurFunction(myVar) {
// init what movieclip to blur
if (myVar == undefined) {
myVar = promoContainer.p1;
}
// BLUR FILTER
import flash.filters.BlurFilter;
import flash.filters.BitmapFilter;
import flash.filters.ColorMatrixFilter;
var blurFilter:BlurFilter = new BlurFilter(0, 0, 3);
desaturation = 1;
var filterArray:Array = new Array();
filterArray.push(blurFilter);
var blurX:Number = 100;
var blurY:Number = 100;
onEnterFrame = function () {
prevPromo._visible = false;
nextPromo._visible = true;
if (desaturation>=1) {
des = -0.03;
} else if (desaturation<=0) {
des = 0;
delete (onEnterFrame);
}
desaturation += des;
// color matrix
//myVar.filters = new Array(getDesaturationFilter(desaturation)); <---- I can have this....
blurX -= 10;
blurY -= 10;
blurFilter.blurX = blurX;
blurFilter.blurY = blurY;
// blur filter
//myVar.filters = filterArray; <---- Or I can have this but not both.......
if (blurY<=0) {
blurY=0;
blurX=0;
//delete (onEnterFrame);
}
};
}
function getDesaturationFilter(t:Number):BitmapFilter {
t = t != undefined ? t : 1;
var r = 0.212671;
var g = 0.715160;
var b = 0.072169;
trace("colormatrixfilter called");
return new ColorMatrixFilter([t*r+1-t, t*g, t*b, 0, 0, t*r, t*g+1-t, t*b, 0, 0, t*r, t*g, t*b+1-t, 0, 0, 0, 0, 0, 1, 0]);
}
Is This Possible? Change Color
Hello,
i have a MC which has only a square.
Is it possible to change the color of that square with action script?
thanks,
Miguel
Color Change
is it possible to transform(with fade effect) the color of a movie clip or a graphic, ive tried the .setRBG and .setTransform, but the color changes right away without the fade...if u kno what i mean plz reply thx
Change Color
I'd like change color of MC bgLista which is inside of MC messaggio. But with (messaggio" add i.bgLista) I can't reach
bgLista and the change color is on messaggio.
What's wrong?????
for (i=0; i<array_length; i++) {
duplicateMovieClip(messaggio, "messaggio" add i, depth);
setProperty("messaggio" add i, _y, yposition);
set("messaggio" add i add ".ListaIdmessaggio", ListaIdmessaggio_array[i]);
set("messaggio" add i add ".ListaDataora", ListaDataora_array[i]);
set("messaggio" add i add ".ListaNickname", ListaNickname_array[i]);
set("messaggio" add i add ".ListaOggetto", ListaOggetto_array[i]);
Lista = new Color("messaggio" add i.bgLista);
i%2==0 ? Lista.setRGB(0xCCCCCC) : Lista.setRGB(0xffffff);
delete Lista;
depth--;
yposition = yposition+25;
}
Thanks in advance
manner
Help Using AS To Change Color
Hi Everyone,
I'm trying to change a small spinning house MC named "house" to a different color using AS... I would like it to change using the hittest method when you just rollover it ... or....
I would like when you rollover the invisable button I have over it to have the rollover code to change the color of the house MC... this is what I have on the invisable button right now and it isn't working:
on (rollOver) {
black = new Color(house);
black.setRGB(OxFFCFCF);
}
on (release) {
gotoAndPlay ("home");
}
FFCFCF is the hexidecimal color I would like to change it to. I would like it to be like a tint function. I got this portion of code from one of the tutorials on the site but I think I have somehow messed it up.
Thanks in advance.
Dwyermm7
|