# Modify style of a component?

**URL:** <https://forum.kirupa.com/t/modify-style-of-a-component/248876>\
**Category:** Uncategorized\
**Created:** [January 12, 2008, 6:06pm UTC](https://forum.kirupa.com/t/modify-style-of-a-component/248876 "2008-01-12T18:06:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Justin\_Fox](https://avatars.discourse-cdn.com/v4/letter/j/6a8cbe/32.png) [@Justin\_Fox](https://forum.kirupa.com/u/Justin_Fox)\
**Post date:** [January 12, 2008, 6:06pm UTC](https://forum.kirupa.com/t/modify-style-of-a-component/248876/1 "2008-01-12T18:06:38Z")

</div>

ok, i have a comboBox with the instance name “testBox”, and when I do the following:

testBox.setStyle(“themeColor”,“haloOrange”);

I get the following errors when I try to view the movie (control-\>Test Movie).

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 20: Statement must appear within on/onClipEvent handler  
testBox.setStyle(“themeColor”,“haloOrange”);  
Total ActionScript Errors: 1 Reported Errors: 1

I don’t understand what this means.

If I could get some help, it would be much appreciated.

Thanks,

Justin Fox
