UI MovieClips, values stuck in scope

I have an MC on stage containing user interface elements.

Within that MC, I have another MC with an onRelease event that calls to a function.

The function it’s calling sets/toggles a variable.

The problem is this: It’s setting the variable in a scope that’s available for the function and the MC within the user interface container, but I also need to make it available to _level0 (to be written to a file via an existing CGI script we have). I’ve tried setting this from within the function, having a loop that copies all the values from that scope to _level0, but I haven’t gotten it to work.

The existing software I’m creating this for is convoluted, and we’re stuck with it, so the goal is really just getting those variables into _level0, and not something that might be cleaner or make more sense.