Written By: if, if@dgap.miptDOTru
Difficulty Level: Advanced
Requirements: Flash MX2004
Topics Covered: Creating MX components and text fields dynamically
Download FLA

Here is a small example how to handle with flash radiobutton components, how to greate, change and remove them dynamically. Understanding this you can simply work with other, its very easy and interesting. Another feature (or bug, you choose ;-) is that everything made in code, and all the code placed in one layer, so you can easily access it.
The game itself is a small test, where you see a RGB color and few choices, including the right one you have to pick. I know, there's no great idea, i wrote it one evening for fun and getting acquainted with components ;-)
So here we go:

Download and open the source.

In the first frame you can see standard preloader, and also some fscommand stuff, it is really useful, lets see:

fscommand("allowscale", false);
fscommand("showmenu", false);

When you forget to disable right mouse button in your swf, someone can use 'play' and 'loop', jumping from frame to frame, leaving objects from previous frames. Thats may look really strange, remove this line and test for yourself. And there's no reason to allow someone scale your swf too ;-) If you placing flash on a web page, you especially should forbid scaling and right button, imho. You can see the example on my site.

Next frame covers the code for the first screen:

createClassObject(mx.controls.RadioButton, "r"+i, i, {
        label:str[i], groupName:"skill", fontFamily:"Verdana", fontSize:"12"}
);

This is what matters here. Simple. Also look at destroying this object when i do garbage collecting and go to next frame.

The next is the most complicated frame, but only because of lots of functions. Hope you'll get some tricks from it, but algorithms maybe not optimized enough ;-) All the serious stuff goes with lots of comments, so understanding won't be a big problem. I divided code into lots of functions for better understanding also.

Last frame covers only game scores and some comments to them.

So you may use this engine to make your own tests, easily changing all parameters.
Enjoy and happy flashing ;-)