Access component properties in MovieClip frames from class file

I have a flash .fla called ZBreak.fla. I have a document class file called ZBreak.as that is linked to the ZBrick.fla. The .fla has the following frames; intro, story, options, play and gameover.

I have components, such as RadioButtons and Sliders in the Options frame. The Play frame has Dynamic text boxes for score, kills, etc. The Play frame also has actionscript code that calls a function in the ZBreak.as file called startZBreak, which kicks off the game.

Within the ZBreak.as file, I can easily access and update the .text property of the Dynamic text boxes on the Play frame by simply referencing something like score_Text.text = 0;

However, from within the ZBreak.as class file, I can not access the properties of the components on the options frame, even though it is in the same MovieClip, just a different frame than the one that called the startZBreak function.

For example, on the options frame, I have a RadioButton group with 3 RadioButtons (level1_RadioButton, level2_RadioButton and level3_RadioButton) that I want the user to use to select the difficulty level of the game.

Within the ZBreak.as file, startZBreak function, I would think that I should be able to do something like...

var difficulty:Number = level1_RadioButton.value;

But in doing so, I get a null reference error. Is each frame its own scope? If so, how do I reference it deom the ZBreak.as file?

Thanks in advance,

Dave
dcadlerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

asaivanCommented:
Each frame is sort of in it's own scope, but to get the values you want to access into that class, you have to pass those values explicitly to the class.  So, somehow, you have to pass values from THAT frame back to the class.  

It would be easier to tell you exactly if you could post your code.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development Software

From novice to tech pro — start learning today.