Forum Moderators: open

Message Too Old, No Replies

changing fill color but not line color

Flash

         

benihana

2:39 pm on May 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ive made a basic color picker to allow people to change the color of certain objects.

im using setRGB, but the trouble is it changes the entire object, and i really want the lines to be black and just have the fill changed.

any suggesstions?
]cheers

Robino

3:00 pm on May 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




Stroke it!

benihana

3:10 pm on May 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



thanks robino - but i cannot find any reference to stroke in the actionscript dictionary - a little more info?

cheers

Robino

3:24 pm on May 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




select the area then -edit->stroke

I assume you're using PS?

benihana

3:27 pm on May 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



PS

no, Flash.

I have made a color picker in actionscript so users can change the color of objects interactively.

Robino

3:31 pm on May 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




Sorry.

I think you go to Window > Panel > Stroke.

benihana

3:40 pm on May 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



i dont think ive made it clear what im tryin gto do.

i have a number of prebuilt objects on the stage, they are currently all white with black outlines.

ive also built a set of varouis color swatches.

when the user clicks on a color swatch , the mouse disappears and a painbucket icon appears, and the color they have selected is stored as a variable. if they then click on one of the prebuilt objects, the actionscript reads the color from the variable, and uses setRGB to change the object to the color they have picked.

the problem is that when the setRGB is called, it colors the entire object, including the outlines. im trying to find a way to keep the outlines black.

just to make it clear, the color transformations are to be performed by the end user when the movie is published.

thanks

winstun

7:45 pm on May 21, 2004 (gmt 0)

10+ Year Member



Are you using MX 2004 and did you make the swatch objects yourself?

Sounds like a cool project btw!

winstun

8:19 pm on May 21, 2004 (gmt 0)

10+ Year Member



... I thought you were having trouble with the color picker before, sorry.

What I think may be happening is the object needs to have 2 parts: a. a stroke and b. a fill ( where fill is the main part of the object to be colored ).

So it could look like this sort of:
Object_mc
-> Stroke_mc
-> Fill_mc

I think you are setting it this way:
Object_mc.myColor.setRGB(0x330033);

Where it should be:
Object_mc.Fill_mc.myColor.setRGB(0x330033);

Let me know if I'm on the right track. :)

benihana

1:18 pm on May 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



thanks winstun - that makes sense to target a mc inside the mc. ill give it shot when i get back to work on monday
:)

yep its 2004.

the project is pretty cool - its a site for kids where they create there own character from prebuilt bodies clothes etc etc - this then becomes there 'guide' through the site

Under influence

1:23 am on May 24, 2004 (gmt 0)

10+ Year Member



My guess would be to make the shapes into seperate symbols, e.g. one for the outline and one for the inside. Apply the same actionscript to both and it should work, haven't tried or tested it myself, try and see how it goes.