Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Color Picker And Dynamic Text Fields



Hello,Okay so I have two problems here and I am not sure how to solve either of them!!Problem 1. Changing the font of a dynamic text field. I know how to do this with the set text format properties etc. etc. using action script, but I only know how to do this if you are creating a text field in action script. I need to change the font of the text in a dynamic text field that is created and remains on the stage. I have a movie clip, and inside that movie clip is the text field, with content all formatted correctly. If i was to add the text field using action script i would loose all of the formating. So is there any way at all that I can change the text field properties using action script of a dynamic text field created on the stage?????Problem 2.The color picker component!! I want to use the colour picker component to change the colour of the text in the dynamic text box mentioned above. Presumably i will have the same problem as above, but that aside, i cant work out how to trace out the color value from the color picker when the user selects it. I tried using the ColorPickerEvent to do this i.e. ColorPickerEvent.CHANGE.......and so on. However I am coding onto the frame instead of an external action script file. and when i export the movie the following error appears: 1046: Type was not found or was not a compile-time constant: ColorPickerEvent.Anyone any ideas how i can fix this??Your help will be greatly appreciated, this is for part of my degree, and am struggling for time now :S Thank you so much for you help in advanceJude :D



Adobe > ActionScript 3
Posted on: 04/25/2008 09:34:16 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

BACKGROUND COLOR OF DYNAMIC TEXT FIELDS
is it possible to change it? I dont want it to be white always
also in kirupas FULL FLASH SITE tutorial he had a nice one under locations!


help!

BACKGROUND COLOR OF DYNAMIC TEXT FIELDS
is it possible to change it? I dont want it to be white always
also in kirupas FULL FLASH SITE tutorial he had a nice one under locations!


help!

[F8] Color Picker For Text
I am wanting to make a color picker for my CMS so that I can change the color of the text. I dont really know where to start with this. I have made a bold, italics, and underline button but I dont really know how to make the color changer would really appriciate if some one could lend some advice or flick a good tutorial my way.
cheers

Dynammic Color Using Color Picker
I am using a friends computer and he has flash cs3. I am just trying to teach myself how to put a "colorpicker" component on my webpage and use it as a UI for the person veiwing my page to change the color of an object.
For instance:



I want to use this colorpicker component, instance name - cPa
to change the color of this box dynamically box instance name - boxa
I barely know anything about action script. I'm visiting him and just trying to kill time while he's at work so I figured I would try this and I need help, Please and thank you.

Color Picker?
Can someone please look at this .fla file and tell me why my movie clips won't change color when I use the the .setRBG function????? I want each button to use it's own color picker to change the color of each movie clip.

http://www.epsoa.com/frame.fla

Thanx,
Joel

Color Picker
Hi,

I need to make a color picker. I have an image in my flashmovie which the user can color. So they can color the hair brown or yellow, etc.
I can make them choose from 20 colors ( I attach the hexadecimal code to the colorbutton), this I can do. I can also make a textfield in which you can type the code yourself. But I want the user to choose from all colors from a colorcircle. This are 6 million colors or something, so I don;t want to do it manually.

Is it possible to substract the color from an image? In this image will be all the colors. Can anyone help???

thanks in advance.

greetz Persoon

Color Picker?
how can i make a button, thats when its clicked, the movie changes to a different color?

thnx

Color Picker
Is it possible to create a color picker in flash? I want a user to change the color of a box by using a color picker. Thanks.

About A Color Picker
Hello,

I am tring to make a color picker where the user slides a bar and a movie clip changes color and also a text box will ahve the color value in it like #FF0000 once the user has finished moving the slider, Does anyone know how to do this or have a .fla file, I know about the flash mx colorpicker but that is not what i want !

Thank you, please !

Color Picker
i am working on a project at the office. i am making a visual display aid where the customer can change the color of their car to simulate paint jobs. what i did was i took a picture of a car and then convert it to semi transparent png. and then i took the car's shape on a new layer and filled it with a solid black.

and then in macromedia flash, i superimposed the transparent image over the black one and then change the black image to a movie clip so the user can change the value of the color via three sliders (much like the one in the flash tut).

the problem in that the transparent image doesnt act solely as a highlight/shadow layer. it also carries with it the original color of the original car.

which is very annoying because if i make it too tranparent, the car would lose its contour and if i raise the opacity, the final color of the car wouldnt be right.

how do i seperate the highlights (and shadows) and the color of the car so i can make the color of the car totally tranparent?

i have been at it for so long my eyes are getting blurry....

[CS3] Help With The Color Picker
i don't know what the hell is the problem. i have a color picker component and a movie clip. i want the movie clip to change color once i use the picker. and have a easy variable to store the color value as well. i'm trying to get the movie clip textX to change color when the color picker's changed. and to have tempColor equal the value as well. this is just a text .fla file to get the code down at least. if someone could spend a minute to take a look i'd really appreciate it. i basically followed the tutorial linked below but i need to change movie clip colors when i click on it. someone please tell me what i'm doing wrong. only 20 or so lines of code. thanks.

the tutorial:
http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000431.ht ml

the .fla file:
http://www.sendspace.com/file/x4q6u5

[CS3] I Need A Color Picker, Please.
hellooooo. i'm havin a real hard time tryin to find a color picker that i can easily use. I'm making an interactive flash file that has a color picker for different colors of an object. the object would most likely be a bunch of individual movieclips. for instance, if the object was a smiley face, one color picker for the circle color, one color picker for the eyes, and one color picker for the smile. it would be great if i could have a variable that has the RGB color value of the last color clicked to keep for other uses. i've used many. if someone could point me in the right direction or show me some code that'd be AMAZING. thanks all.

Color Picker
I want to load an image into my swf using loadmovie and be able to pick color where i click on the image. Can someone plz help me with the code for that.
Thanks

I Need A Color Picker
hellooooo. i'm havin a real hard time tryin to find a color picker that i can easily use. I'm making an interactive flash file that has a color picker for different colors of an object. the object would most likely be a bunch of individual movieclips. for instance, if the object was a smiley face, one color picker for the circle color, one color picker for the eyes, and one color picker for the smile. it would be great if i could have a variable that has the RGB color value of the last color clicked to keep for other uses. i've used many. if someone could point me in the right direction or show me some code that'd be AMAZING. thanks all.

Color Picker
Hey there,

Is there any way possible to have a color picker that works in Flash Player 6? All the components I can find only work in 8 and from what I can see getPixel only works in 8. Do I have any other options???

Thanks!!!

Color Picker
Does anyone know how to create a color picker in flash so that you could pick any color from the color palette and change a movieclip color to the selected color? Something like Color Swatch panel.

Color Picker
can we create color picker tool using flash action script.

Color Picker
I want to load an image into my swf using loadmovie and be able to pick color where i click on the image. Can someone plz help me with the code for that.
Thanks

Help With Color Picker
Hello everyone,
i want to make something like this http://www.crownpaint.co.uk/colour/6...mer-yellow.htm
I have downloaded color picker from http://www.jumpeyecomponents.com/Fla...ker-Pro-V3-37/

So with this i have made thing similar like i want, when i choose color my object change color. My question is how can i make like here http://www.crownpaint.co.uk/colour/6...mer-yellow.htm that my walls change color, how can i expound walls on different parts so that looks like on example i show it to you.
any suggestion would be helpfull.

Mulitple Text Fields - Same Color
Hopefully there is an easy solution for this, I'm an actionscript beginner and can't think of any way of doing this..

I have several dynamic text fields called "field1" "field2" "field3" etc. Is there a way I can assign the same text color to all of these fields without doing something like this:

field1.textColor = 0x0000CC;
field2.textColor = 0x0000CC;

?

Smart Color Picker
I'm trying to create 3 cubes, each one has 1 color:
blue
yellow
and green.

and there's 1 big cube.

When I'll click the green (for example)
cube a varaible will be set with
the hexa color value and will have a name like "activecolor"

then when I'll click on the big cube it will change it's color
to the "activecolor" value (which changes from cube to cube).

Any help is needed
thanks
elad

:: Live Color Picker :: U R G E N T ::
hi all

i am from NID
i am working on flash with web cam
i have some problem regarding the actionscript there is any method to pick the live color (if somebody stand infront of webcam it detects the persons wearing cloths color)
plz help me regarding this issues

Manish

Color Picker Sample
I'm using the script from the color picker sample to change the color of a movie clip at runtime.

I have a picture of a car with an overlay that changes to create the appearance of a changing paint color. I have everything working except i need to set the alpha for the movieclip lower so you can see the picture behind it.

I want the alpha to be set permanently at 35% without a slider. I used a "setProperty" command to change the movieclip but it changes to solid. how do set a permanent alpha?


Code:
// create colors
carColor = new Color(car);
color1 = new Color(previewbox);
color2 = new Color(chip.chipfill);
//
this.onEnterFrame = function() {
// set c1, c2, c3, hc1, hc2, and hc3 equal to the positions of their respective faders and vice versa
for (i=1; i<=3; i++) {
this["color"+i].setRGB(rgb);
this["hexc"+i+"Text"].onKillFocus = function() {
hexMode = false;
};
this["hexc"+i+"Text"].onSetFocus = function() {
hexMode = true;
};
fader = this["fader"+i].knob;
if (dragging) {
this["c"+i] = fader._y;
this["hc"+i] = this["c"+i].toString(16);
} else {
if (hexMode) {
fader._y = parseInt("0x"+this["hc"+i]);
this["c"+i] = parseInt("0x"+this["hc"+i]);
} else {
fader._y = this["c"+i];
this["hc"+i] = Number(this["c"+i]).toString(16);
if (this["c"+i]>255) {
this["c"+i] = 255;
}
}
}
}
//
// combine c1, c2, and c3 into one variable using bitwise left shift and bitwise OR
rgb = (c1 << 16 | c2 << 8 | c3);
};
//
// make color chip draggable when preview box is clicked
//
// hide color chip and stop dragging when mouse button is released, and set car color if chip is
// droppped on the car or the apply button is clicked
previewBox.onRelease = swatchDrop;
previewBox.onReleaseOutside = swatchDrop;
//
function swatchDrop() {
with (chip) {
if (car.hitTest(_x, _y, true)) {
carColor.setRGB(rgb);
}
_y = -20;
stopDrag();
}
}
apply.onRelease = function() {
carColor.setRGB(rgb);
};
//
// set color values equal to the color of the clicked button
swatch1.onRelease = function() {
c1 = 127;
c2 = 0;
c3 = 97;
};
swatch2.onRelease = function() {
c1 = 130;
c2 = 0;
c3 = 0;
};
swatch3.onRelease = function() {
c1 = 10;
c2 = 106;
c3 = 0;
};
swatch4.onRelease = function() {
c1 = 0;
c2 = 51;
c3 = 51;
};
swatch5.onRelease = function() {
c1 = 0;
c2 = 51;
c3 = 102;
};
swatch6.onRelease = function() {
c1 = 127;
c2 = 127;
c3 = 127;
};

Color Picker Code
I want to load an image into my swf using loadmovie and be able to pick color where i click on the image. Can someone plz help me with the code for that.
Thanks

Creating A Color Picker
hello, what im basicly tring to make is this http://www.clydesheds.com/template/Quaker.swf however i dont know how to start it i found something that will do somewhat the same thing but not really because it uses colors instead of the images, what i want to do is bring my image and be able to change the color of the roof and so on using symbols or whatever

myColor = new Color(_root.carColor);
//Declare path and function for 4 color button objects
_root.blue.onRelease = function(){
myColor.setRGB(0x0000ff)
}
_root.red.onRelease = function(){
myColor.setRGB(0xff0000)
}
_root.green.onRelease = function(){
myColor.setRGB(0x00ff00)
}
_root.black.onRelease = function(){
myColor.setRGB(0x000000)
}

this is what i found but it uses colors only, i want to be able to click on the button and replace what is there for a graphic symbol. any help is appreciated

Help With Color Picker Component Please?
I am using a friends computer and he has flash cs3. I am just trying to teach myself how to put a "colorpicker" component on my webpage and use it as a UI for the person veiwing my page to change the color of an object.
For instance:



I want to use this colorpicker component, instance name - cPa
to change the color of this box dynamically box instance name - boxa
I don't know anything about action script.

I don't know how to get the rgb value from cPa after somebody chooses a color and apply it to the movie clip boxa. I know this is very simple but I can't figure it out. I am very new to flash. About all I can do is make tweened animations.
As you can see I can get the color picker on the stage and draw a box then convert it to a "movie clip" but, that's about all.

Color Picker Issues
hey guys,

OK, so i have this problem. i am working with a couple of color pickers. and i can select the colors just fine but i can't change them after i have made a selection.

VerifyError: Error #1107: The ABC data is corrupt, attempt to read out of bounds.
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at fl.controls::ColorPicker/onSwatchClick()

now i have read about this being common, but i need a workaround... here's what i have that works the first time but as i soon as i got to change the color spaz's:

var fmt:TextFormat = new TextFormat();
cp.colors = new Array(took out the long array )
cp.selectedColor = cp.colors[0];
cp.addEventListener(Event.CHANGE,
function changeHandler(evt:Event):void {
var tf:TextField = outputTB1 as TextField;
fmt.color = cp.selectedColor;
tf.setTextFormat(fmt);
}
);

any help is again appreciated

Color Picker For Drawing API
I used Color Picker components from Flash CS3 on the stage for allowing me to pick any colors for drawing api.

I put the codes:

ActionScript Code:
import fl.events.ColorPickerEvent;

addEventListener(Event.ENTER_FRAME, onEnterFrame);
function onEnterFrame(event:Event):void
{
    graphics.moveTo(mouseX, mouseY);
    stage.addEventListener(MouseEvent.MOUSE_DOWN, down);
    cpColor.addEventListener(ColorPickerEvent.CHANGE, changeHandler);
}

function down(event:MouseEvent):void
{
    graphics.lineStyle(1,0x000000,1);
    removeEventListener(Event.ENTER_FRAME, onEnterFrame);
    stage.addEventListener(MouseEvent.MOUSE_MOVE, startDraw);
    stage.addEventListener(MouseEvent.MOUSE_UP, up);
   
}

function startDraw(event:Event):void
{
    graphics.lineTo(mouseX, mouseY);
}

function up(event:MouseEvent):void
{
    addEventListener(Event.ENTER_FRAME, onEnterFrame);
    stage.removeEventListener(MouseEvent.MOUSE_MOVE, startDraw);
}

clear_btn.addEventListener(MouseEvent.MOUSE_UP, clearCanvas);


function clearCanvas(event:Event):void
{
    graphics.clear();
}

I played the screen and I didn't see the error output, but color change is not working when I picked to draw on the screen.

can you tell me why it does not work? thank you

Color Picker Upgrade?
Is there any way to get a better color picker for flash?

Its ridiculous how primitive the current one is.

Add-on Color Picker / Space
Does anyone else agree that the color picker in flash is weak?

I am colorblind and need all the help I can get when choosing colors. I don't understand why they don't just integrate the same color picker that is in photoshop.

Is there any kind of add on or upgrade for cs4 that will give me a more sophisticated color picker? One with sliders, HSB RGB CMYK and LAB (ideally)

Color Picker Code
I want to open an image using loadMovie and than be able to pick color where I click on the image. Can someone plz help me with the code to achieve that.

Issue With Color Picker
I have a coloring book functionality. The user can select a color from a color picker palette and apply it to part of a person on the stage.

The color the user chooses is bleeding or the borders of the picture.

For example if the user chooses purple to paint the persons face the color bleeds over the outline of the character's eyes a few pixels.

or

the chosen color of the shirt bleeds into the color of the buttons a little.

Thanks in advance for your assistance

Color Swatch Picker
I'm trying to make a color-swatch picker for a real estate site (swatches for house colors). I did a pretty good job (for me) of actionScripting the swatches. But I think I need assistance...

In the .fla the swatches gray MCs with related AS linked through separate AS/text files (which define's the swatch's color). They're text files so the client can change the hex numbers without knowing Flash. There's also a Tool Tip that shows the model number on mouseover, but this is NOT in that text file.

There are nine swatches, so I have nine different AS/text files for them.

How can I make it so all the info for swatch colors AND tooltips are in one AS/text file rather than in several? Would this be some sort of array? (I'm not sure how to set that up.)

Generate Color Picker
Hi,

I'm trying to make a color picker / swatch similar to the one in flash but I can't seem to go in the right direction,

there are 6x6x6 colors to be displayed in order, from top left 000000 to bottom right FFFFFF.
In each 6x6 square, horizontal adds Green, vertical adds Blue, each 6x6 square adds a shade of red.

The hex values for a color are : 00,33,66,99,CC,FF. each of them adds 1/5 of 255(51) to the color...

I've got the drawing part ok but what I'm missing is an array of color...


Any help / hint / advice / comment would be greatly appreciated.


Sebastien

Color Picker Class
Needed a little color picker for a project and wanted entirely scripted, so came up with this (the color picker class needs the Grid class, so I'll put both here):
OBO_ColorPicker.as:

ActionScript Code:
import com.onebyonedesign.utils.Grid;import flash.filters.DropShadowFilter;import flash.display.BitmapData;import flash.geom.ColorTransform;import flash.geom.Transform;class com.onebyonedesign.utils.OBO_ColorPicker {  private var _displayWidth:Number; private var _displayHeight:Number; private var _currentColor:Number; private var _displaySwatch:MovieClip; private var _swatches:MovieClip; private var __parent:MovieClip; private var _swatchBmp:BitmapData; private var _cxf:ColorTransform; private var _xf:Transform;  public var onColorSelected:Function; public var onColorHover:Function;  /** * @author  Devon O. Wolfgang * @date   3/2/2007 5:46 PM * @description Creates a "color picker" for user to choose a custom color from a palette of 216 web safe choices. *     Broadcasts onColorHover() event when mouse is moved over swatch palette. *     Broadcasts onColorSelected() event when a color is selected. *     Requires class com.onebyonedesign.utils.Grid. *  *  * @param  w    Number: width of color display * @param  h    Number: height of color display   * @param  defaultColor Number: default color color picker * @param  parent   MovieClip: the parent of the color picker (could be _root of .swf, but an empty MovieClip is recommended). *  *  * @usage  import com.onebyonedesign.utils.OBO_ColorPicker;     var cp_mc:MovieClip = this.createEmptyMovieClip("cp", this.getNextHighestDepth());     cp_mc._x = 200;     cp_mc._y = 200;     var my_cp:OBO_ColorPicker = new OBO_ColorPicker(30, 30, 0x000000, cp_mc);     my_cp.onColorSelected = function(col:Number) {      trace(col);     }; */   // Public  function OBO_ColorPicker(w:Number, h:Number, defaultColor:Number, parent:MovieClip) {  _displayWidth = w;  _displayHeight = h;  __parent = parent;  _currentColor = defaultColor;    init(); }  public function set enabled(bool:Boolean):Void {  _displaySwatch.enabled = bool; }  public function get color():Number {  return _currentColor; }  public function get colorString():String {  var col:String = _currentColor.toString(16);  var colArray:Array = col.split("");  var len:Number = colArray.length;  if (len < 6) {   for (var i = len; i < 6; i++) {    colArray.unshift("0");   }  }  return colArray.join("").toUpperCase(); }  // private  private function init():Void {  createDisplaySwatch();  createSwatches();  initDisplaySwatch(); }  private function createDisplaySwatch():Void {  _displaySwatch = createMovieClip(_displayWidth, _displayHeight, _currentColor, __parent);  _xf = new Transform(_displaySwatch);  _cxf = new ColorTransform(); }  private function createSwatches():Void {  _swatches = __parent.createEmptyMovieClip("s", __parent.getNextHighestDepth());  var swatchWidth:Number = 10;  var swatchHeight:Number = 6;  var colorArray:Array = makeColorArray();  var grid:Grid = new Grid(12, 18, swatchHeight, swatchWidth, 0, 0);  var len:Number = grid.length;  for (var i = 0; i < len; i++) {   var swatch:MovieClip = createMovieClip(swatchWidth, swatchHeight, colorArray[i], _swatches);   swatch._x = grid[i].x;   swatch._y = grid[i].y;  }  initSwatches(); }  private function initDisplaySwatch():Void {  var cp:OBO_ColorPicker = this;  _displaySwatch.onRelease = function() {   cp.showSwatches();   this.enabled = false;  } }  private function createMovieClip(w:Number, h:Number, c:Number, par:MovieClip):MovieClip {  var mc:MovieClip = par.createEmptyMovieClip("s" + par.getNextHighestDepth(), par.getNextHighestDepth());  with (mc) {   beginFill(c);   moveTo(0, 0);   lineTo(w, 0);   lineTo(w, h);   lineTo(0, h);   endFill();  }  return mc; }  private function makeColorArray():Array {  var hArray:Array = new Array("00", "33", "66", "99", "CC", "FF");  var cArray:Array = new Array();  var len:Number = hArray.length;  for (var r = 0; r < len; r++) {   for (var g = 0; g < len; g++) {    for (var b = 0; b < len; b++) {     cArray.push(Number("0x" + hArray[r] + hArray[g] + hArray[b]));    }   }  }  return cArray; }  private function initSwatches():Void {  var cp:OBO_ColorPicker = this;    _swatchBmp = new BitmapData(_swatches._width, _swatches._height);  _swatchBmp.draw(_swatches);  _swatches.filters = [new DropShadowFilter(4, 90, 0x000000, .6, 5, 5, 1, 3)];  _swatches.useHandCursor = false;  _swatches.onRollOver = function(){   this.onMouseMove = function() {    cp._cxf.rgb = cp._swatchBmp.getPixel(this._xmouse, this._ymouse);    cp._xf.colorTransform = cp._cxf;    cp.onColorHover(cp._cxf.rgb);   }  }  _swatches.onRollOut = _swatches.onDragOut = function() {   delete this.onMouseMove;  }  _swatches.onRelease = function() {   cp._currentColor = cp._swatchBmp.getPixel(this._xmouse, this._ymouse);   this._visible = false;   cp.onColorSelected(cp._currentColor);   cp._displaySwatch.enabled = true;  }  _swatches._visible = false; }  private function showSwatches() {  // position swatches  _swatches._x = _displayWidth + 5;  _swatches._y = -(_swatches._height) + _displayHeight;  var pt:Object = {x:_swatches._x, y:_swatches._y};  __parent.localToGlobal(pt);  if (pt.y < 0) _swatches._y = 0;  if (pt.x + _swatches._width > Stage.width) _swatches._x = -(_swatches._width) - 5;  _swatches._visible = true; }}


Grid.as

ActionScript Code:
/*** Grid class* @author: Devon O.* @date: 15JAN06*/class com.onebyonedesign.utils.Grid extends Array { private var _cols:Number; private var _rows:Number; /**  * Grid returns an array of objects with x and y coordinates (properties) based on the number of columns,  * rows, height and width of cells, and the x and y value of the upper left corner.  *  * @usage   myGrid=new Grid (columns, rows, cellHeight, cellWidth, topLeftCornerX, topLeftCornerY)  * @param   cols:   The number of columns  * @param   rows:        The number of rows  * @param   cellHeight:  The height of the grid cell  * @param   cellWidth:   The width of the grid cell  * @param   x:           The x position of the top left corner of the grid  * @param   y:           The y position of the top left corner of the grid  * @return  Grid (an array of objects each containing two properties: x and y)  */ public function Grid (cols : Number, rows : Number, cellHeight : Number, cellWidth : Number, x : Number, y : Number) {  _cols = cols;  _rows = rows;    var numCells : Number = cols * rows;  var curx : Number = x;  for (var i = 0; i < numCells; i ++)  {   this [i] = new Object ({x : curx, y : y});   curx += cellWidth;   if ( ! ((i + 1) % cols))   {    curx = x;    y += cellHeight;   }  } } // /**  * The shuffle method will return the array of grid coordinates in a random order.  *  * @usage myGrid.shuffle()  * @return  Void  */ public function shuffle () : Void {  var len : Number = this.length;  var temp : Object = new Object ();  for (var i = 0; i < len; i ++)  {   var rand : Number = Math.floor (Math.random () * len);   temp = this [i];   this [i] = this [rand];   this [rand] = temp;  } }  // Getters  public function get columns():Number {  return _cols; } public function get rows():Number {  return _rows; }}


A quickie example: http://www.onebyonedesign.com/flash/colorPicker

Color Swatch Picker
I'm trying to make a color-swatch picker for a real estate site (swatches for house colors). I did a pretty good job (for me) of actionScripting the swatches. But I think I need assistance...

In the .fla the swatches gray MCs with related AS linked through separate AS/text files (which define's the swatch's color). They're text files so the client can change the hex numbers without knowing Flash. There's also a Tool Tip that shows the model number on mouseover, but this is NOT in that text file.

There are nine swatches, so I have nine different AS/text files for them.

How can I make it so all the info for swatch colors AND tooltips are in one AS/text file rather than in several? Would this be some sort of array? (I'm not sure how to set that up.)

Monitor Color Picker
How can i pick a pixel's color hexcode with actionscript, like Pixie freeware (http://www.nattyware.com/pixie.html) but conceived through the magic of actionscript?

Color Picker Problem
hi guys ... i have this simple color picker class, that creates a group of coloured squares, based on an array ... each of the boxes has a mouse click event listener linked to the colorSquareRelease function .... what i need to be able to do in the function is trace out the specific i value that relates to the square you clicked on. e.g if I click on the red square, I want to be able to trace out 3.

I used to be able to do this easily in as2 using a different method, but not in as3.

I hope someone can help

Regards

Bongo


ActionScript Code:
package colorPicker {
   
    import flash.display.Sprite;
    import flash.events.MouseEvent;
 
    public class ColorPicker extends Sprite {
       
        static protected var colorArray:Array = new Array();
        colorArray[0] = 0x000000;
        colorArray[1] = 0x333333;
        colorArray[2] = 0x666666;
        colorArray[3] = 0xFF0000;
        colorArray[4] = 0x990000;
        colorArray[5] = 0x0000FF;
        colorArray[6] = 0x000066;
        colorArray[7] = 0x00FF00;
        colorArray[8] = 0x006600;
        colorArray[9] = 0xFFFF00;
        colorArray[10] = 0xFF9900;
        colorArray[11] = 0xFFFFFF;
       
        static protected var rowLength:uint = 6;
       
        //////////////////////////////////////////////////CONSTRUCTOR
        public function ColorPicker() {
            super();
        }
        //////////////////////////////////////////////////
       
        //////////////////////////////////////////////////METHODS
        public function createColorPicker(holder:Sprite) {
            for (var i:Number = 0; i < colorArray.length; i++) {
                var colorSquare:Sprite = new Sprite();
                colorSquare.name = i.toString();
                colorSquare.graphics.lineStyle(1, 0x000000);
                colorSquare.graphics.beginFill(colorArray[i]);
                colorSquare.graphics.drawRect(7, 7, 14, 14);
                colorSquare.x = ((i - ((Math.floor(i / rowLength)) * rowLength)) * 14);
                colorSquare.y = Math.floor(i/rowLength) * 14;
                holder.addChild(colorSquare);
                colorSquare.buttonMode = true;
                colorSquare.addEventListener(MouseEvent.CLICK, colorSquareRelease);
            }
           
        }
        public function colorSquareRelease(event:MouseEvent) {
            trace("this = " + this);           
        }
        //////////////////////////////////////////////////
       
    }
   
}

Flash Hex Color Picker Help
Im looking for a simple hex color picker, preferably with 256 colors.

i found a few on flashkit.com, but they were not customizable, i.e. you would have to go through and change each button to call your function.

anyone know of a free one of these that was made so you can customize the function call?

How To Color Input Text Fields In Flash...plz Help
I am making a small email form on my homepage. The default input text box color is white. I have seen sites where they are colored. How can I do this? Thanks.

How Do I Change The Background Color Of Text Fields?
Hi,

Is there a way to change the background color of a text field? I have a text field with the border enabled, and the background color of the field changes to white. I would like to change its color to another color (or even to transparent, if possible), but I can't find a way to do it at design time.

I know that it is possible to change the color with ActionScript using the backgroundColor property, or even disabling it with the background property, but I didn't find anything about doing that on the Flash interface.

Can someone help me?

Best regards
Norberto

Color Picker And Fill Tool
i need a help..
i want to pick color and set color in drawings..

there is a color pallete, i want to click and get the value in a variable and i have defferent mc, when i click on some mc, the mc should get the previously chossen collor...


please help...

Eye Dropper-Like Color Picker - You All Said It Was Impossible
A while back I said it was possible to make a color picker. Everyone said it was impossible. Now, I didn't make this one. I haven't even tried yet, been busy with other stuff. But I just had to show you it was possible.

http://www.flashcomponents.net/compo...m?nav=2&id=113

If you look at his code, it pretty clever even if it does not detect the color like a real eye dropper tool.

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();
}
}

Color Picker And Movie Clip
Hello,

i have col. picker and movie clip and i wanna change color of that MC. My CP is from data components and i don't know how to do it.

example:

mycolor= new Color (picker)
mycolor setRGB(0x ???what??)

Color Picker Panel Towards Left
hi,

i am using Flash CS3 colorPicker component, which when clicked shows a pallete in the right side of its icon.

i want to change towards it to left. how could it can be changed?

any solution?

Creating A Color Picker With BitmapData
how can i create a color palette dialog in my swf, like the color picker panel in flash ide. should i use the bitmapdata class and how?

Does Flash8 Provide The Color Picker?
does flash 8 provide a color picker component/movie clip or else?
someone said yes from the previous post.
but i am not sure.

thank you

pixelmana

Color Picker For Image Not In Flas
Is it possible to detect the color of the desktop below the mouse? I want to make a very small Flash widget that will allow me to detect the color of a pixel in an image on a web page (not inside a Flash app) and then display it or pass it through to a web form.
Is this possible?

Copyright © 2005-08 www.BigResource.com, All rights reserved