How to play sounds depending on a value in a movie clip?

[COLOR=#000000][FONT=Arial]I have a movie clip layer (in main timeline) named “options_mc” inside of it; it contains a dynamic text field (onoff_txt) that changes to 0 or 100 when a button (sound_btn) is clicked. If the value is 100, then sounds should play…if it is 0, sounds should not play. On a different layer in a movie clip on the main timeline, I have the sound channel “tchannel” I added a function in that same layer which goes like this:

[/FONT][/COLOR][COLOR=#2B91AF][FONT=Consolas]CheckSound[/FONT][/COLOR][COLOR=#000000][FONT=Consolas]();[/FONT][/COLOR]
[COLOR=#00008B]function[/COLOR] [COLOR=#2B91AF]CheckSound[/COLOR]():[COLOR=#00008B]void[/COLOR]
 {
 [COLOR=#00008B]if[/COLOR](options_mc.onoff_txt == [COLOR=#800000]100[/COLOR])
 {
 tchannel = theme.play([COLOR=#800000]0[/COLOR],[COLOR=#800000]9999[/COLOR]);
 }
 [COLOR=#00008B]else[/COLOR] [COLOR=#00008B]if[/COLOR](options_mc.onoff_txt == [COLOR=#800000]0[/COLOR])
 {
trace([COLOR=#800000]"noplay"[/COLOR]);
 } [COLOR=#000000][FONT=Consolas] [/FONT][/COLOR][COLOR=#000000][FONT=Consolas]}[/FONT][/COLOR][COLOR=#000000][FONT=Arial]

[/FONT][/COLOR][COLOR=#000000][FONT=Arial]The sound does not play at all, nor does a trace statement appear. What is wrong with my code?[/FONT][/COLOR]