...I am wanting to run a color of instance test. I am
wondering if I can do this?
attachMovie(shapes,shapes,num);
if( shapes /*color*/ == 0x33){
// action(s)
}
// this is sudo code but basically I want to know if I can
test for color.
A library symbol doesn't have a
I don't think u can check the color of the mc which is set at authoring time
When u set the color of the mc through a color object u can retrive the
color
Here is the code
var my_color:Color = new Color(mc);
my_color.setRGB(0xFF);
// my_mc turns red
Please, test the code below:
import flash.geom.Transform;
import flash.geom.ColorTransform;
var transf:Transform = new Transform(mc);
var color:ColorTransform = new ColorTransform();
transf.colorTransform = color;
color.rgb = 0x99;
trace(color.rgb);
trace(0x+color.rgb.toString(16));
if
Take a look at the BitmapData function:
getColorBoundsRect()
It might be handy. It can certainly tell you if a clip contains any
specific colour (if you take a BitmapData copy of the clip first).
If not, I guess getPixel() and getPixel32() might be of help.
Hope that's helpful,
Ian
On
you can test for colour by taking a bitmap data snapshot and using getPixel
or getPixel32 on it.
On 5/10/07, Danny Kodicek [EMAIL PROTECTED] wrote:
...I am wanting to run a color of instance test. I am
wondering if I can do this?
attachMovie(shapes,shapes,num);
if( shapes /*color*/ ==
get color through getPixel method:
import flash.display.BitmapData;
var mc:MovieClip = this.attachMovie(mc, mc2, 1);
var bmp:BitmapData = new BitmapData(mc._width, mc._height, false);
bmp.draw(mc);
color = bmp.getPixel(mc._x, mc._y);
trace(color.toString(16));
[]'s
Leandro Amano
On 5/10/07,
Please, test the code below:
import flash.geom.Transform;
import flash.geom.ColorTransform;
var transf:Transform = new Transform(mc); var
color:ColorTransform = new ColorTransform();
transf.colorTransform = color; color.rgb = 0x99;
trace(color.rgb); trace(0x+color.rgb.toString(16));
if
Hi Jason,
[]'s = hug's, regards...
I finished to send another example with getPixel().
But I did not understand its email of reply, is an attack?
I'm sorry for some aggression badly understood...
bye
Leandro Amano
On 5/10/07, Merrill, Jason [EMAIL PROTECTED] wrote:
Please, test the code
8 matches
Mail list logo