I’m trying to pass the value picked from the color picker to a text field. I am attaching the .fla…
you will see that when you click on the color picker, it sets the color of the mc… I also want it to set the variable fcolor when picked.
the swf can be viewed at http://www.aulman.com/mxdab/ford0.html
if you just want to view the file first… the text down below should change to the hex # when picked…
Any help is appreciated…
Rev
<a href =“http://www.aulman.com/mxdab/ford1.fla ”> fla here </a>
system
December 12, 2002, 3:15am
2
You forgot to post your FLA
And you know what, that is one thing I never learned in Flash with colors. And that is how to convert RGB into Hex in Flash. I am babbling.
Hey, you edited! No fair!
system
December 12, 2002, 3:17am
3
Oh, I can’t help I guess…
It says Flash MX does not support Generator content.
I will give it a whirl anyways.
system
December 12, 2002, 3:19am
4
lost:
ignore that…
I am trying to convert the current site (yes, I just finished it) to MX, so that he can put it on CD (can’t do that with Gen2)…
thanks for trying…
Rev
system
December 12, 2002, 3:23am
5
Hmm, components… yuk…LOL.
No problem, I ignored it, and am trying still.
system
December 12, 2002, 3:53am
6
thanks lost
If you can think of an easier way to do this, let me know…
as you know, my MX knowledge is growing, but not as fast as my clients wish…
thanks,
Rev
system
December 12, 2002, 4:14am
7
ARGH!!!
This thing is really :beeeeeep:
Well I tried a billion methods, and none worked. There is one method I used that worked great, but will be incredibly tedious to implement.
It requires you change the on(release) of all your buttons inside the component itself.
You must set the var name of your textbox to rcolor (not the instance name… and yes, this is for the rear text box.
Use this on each of the color buttons…
on (release) {
setMyBackground = "0x000000";
myColor.setRGB(setMyBackground);
_root.rcolor = setMyBackground;
}
The problem with this other than the fact that it is a pain in the arse, is that, since you are editing inside the component itself, it effects the one for the front part as well!
Although this really doesn’t help much, I thought I would let you know my progress thus far.
Not sure if I can do this, but I will press on
system
December 12, 2002, 4:33am
8
Lost:
I said that too… AAAAArrrggggghhhhh… that’s why I decided to finally ask here :beam:
yeah, I already had come up with the tedious solution. That is how I tested to know what I was trying, was possible at least… trying to avoid doing anything that tedious, if possible…
If it has to be just 1 variable, then I could do this in 2 swfs (that is how I currently do it)… I would rather not, but I would rather do that than use my current beat Flash5 version I built…
thanks again for melting a brain cell or 2 on this…
Rev
system
December 12, 2002, 5:41am
9
Lost:
is there a way to use getRGB to get the color value of frontcolor, and pass it to fcolor via the close button on the component?
that would save having to copy and paste 256 times…
just a thought…
Rev
system
December 12, 2002, 5:42am
10
Oh, believe me, I thought of that. And I couldn’t get it to work at all
system
December 12, 2002, 5:42am
11
great minds run in the same gutter…
Rev
system
December 12, 2002, 6:04am
13
okay, different tack…
how do I get the hex value of a movie clip?
I mean, I can set it, but how do I find out what that was…
my brain hurts…
[SIZE=1]:: said with a hankerchief on his head, while hitting himself with a brick ::[/SIZE]
Rev
system
December 12, 2002, 6:06am
14
That would be getRGB, but you can only get it after you set it.
Well you don’t get it from the clip, you get it from the color object, which is inside the component and is called myColor.
I tried using getRGB, but it just would not work
system
December 12, 2002, 6:10am
15
A little something to show what I mean…
Create a movie clip on the stage and give it the instance name “ball” (no quotes).
But these actions on a Frame…
myColor = new Color(_root.ball);
myColor.setRGB(0xFF0000);
trace(myColor.getRGB().toString(16));
system
December 12, 2002, 6:13am
16
yeah, I may end up doing the tedious way… or I may just use the one I made up w/ just a few colors…
just a question, if you weren’t using components, and wanted to do this color picker, what would you do?
Rev
system
December 12, 2002, 6:18am
17
No clue man. Probably the same way as the component, but less difficult.
Like you press the button and it shows the color picker (through attachMovie?), that clip will contain your pallette.
Then on a frame in the _root you will declare your new Color() object.
And the buttons inside your clip will use
_root.myColor.setRGB(0xFF0000)
And hopefully you will be able to change your textbox to read with the getRGB (which I showed how to use in the last post).
In theory…lol.
system
December 12, 2002, 6:22am
18
Okay, same way as me…
I gotta work on something else first anyway… I was just thinking this would be cool, if I could get it to work…
The client knows nothing of this… in case I run out of time…
thanks for the brain fry…
Rev