Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 391
  • Last Modified:

checkbox color

I have a checkbox on the scene and I want to change the color of the check mark (symbol) to red.

How can I do this ???

Thanks
0
Megafab
Asked:
Megafab
  • 8
  • 8
1 Solution
 
blue-genieCommented:
simply use the getStyleFormat. like so:

globalStyleFormat.check = 0xFF0000;
globalStyleFormat.applyChanges();

put the 2 lines of code above in the main timeline in the beginning - thats all.

blu.
0
 
MegafabAuthor Commented:
I've already try this but it's not working
0
 
blue-genieCommented:
post your file somewhere.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
MegafabAuthor Commented:
there is nothing in my fla. Just take a CheckBox component from MX 2004, and drag it on the scene, that's all.

0
 
blue-genieCommented:
then it should work - check your syntax.

ps. you do realise it only shows up at runtime?
0
 
MegafabAuthor Commented:
syntax in correct.

doesn't work on publish..

An other idea ???


(Using Flash MX 2004 Pro, Publish in player 7 & AS2, CheckBox component, not FCheckBox from Flash MX)
0
 
blue-genieCommented:
i can only suggest you post the fla so we can see whats going on.
0
 
MegafabAuthor Commented:
Can I send it to your mail box ???
0
 
blue-genieCommented:
ok
blue-genie(at)bigfoot.com

(Note to moderators: I'll post the solution if I find it.)

blu.
0
 
MegafabAuthor Commented:
flash file has been sent tou you mail box
0
 
blue-genieCommented:
Hi there.
I just learned something new, the styling of the UI 2 components is a totally different story, nothing as simple it seems as the UI 1 components.

So nothing wrong on your part.

Here's the solution I came up with - after browsing many different sites.

Have a look at these sites:
http://www.peachpit.com/articles/article.asp?p=101723&seqNum=4
http://livedocs.macromedia.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/js/html/wwhelp.htm?href=00002028.html#wp1129866_7_2/00003072.html

This is what i figured out.
According to the macromedia live docs, what property is available to the component depends entirely on the theme that is applied.
the property we're looking for is called "symbolColor" - this apparently changes the check in the checkbox and the dot in the dot box - symbolColor can only be used with the Sample Theme, NOT the halo theme which is the default.
So the first thing you need to change the theme.
I would have thought it was as simple as setting the theme color, but according to the live docs, No such luck, it involves opening external library, and copying those classes for that theme over. *breathe* - read here for the whole shebang -
http://livedocs.macromedia.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/js/html/wwhelp.htm?href=00002028.html#wp1129866_7_2/00003072.html

anyways, once that's done a simple line of:
_global.style.setStyle("symbolColor", 0xFF0000);
does the trick.

ps. if you want a different red you need to set it. (live docs also tells you how)

blu.
*phew*
0
 
MegafabAuthor Commented:
Is it possible to get a working example ??
0
 
blue-genieCommented:
yeah, ok, go grab it here.
http://www.geocities.com/bluegenie_sa/component/checkBox.zip

just remember you must swap out your theme.

blu.
0
 
MegafabAuthor Commented:
great job, you are the best of the world.

****ing cool.

RnR

Megafab
0
 
blue-genieCommented:
:-) was hard work for 50pts!!!

you're welcome - i learned something in the process.
0
 
MegafabAuthor Commented:
I thought it was easier ;-)
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 8
  • 8
Tackle projects and never again get stuck behind a technical roadblock.
Join Now