- Home
- Articles
- Best Practices
- Setting up a Development Environment and Using gProject to Create Custom Classes

Controlling your new TestObject in your Main Class
Victor Gaudioso
Victor Gaudioso is a Sr. Application developer for an advertising firm in Hollywood, CA. He specializes in Flash / ActionScirpt but also programs in other languages including but not limited to C#, XAML, WPF and ASP .NET. He has engineered Flash sites for the major entertainment studios including Disney, Universal, TouchStone, Mattel and Warner Bros. among others. Victor is known as dvlnblk in the http://actionscript.org forums and has recently been appointed a site moderator. AIM: dvlnblk2004 Yahoo: victoratdeadline
View all articles by Victor GaudiosoYou will be happy to hear that gProject makes this so simple a child can do it (granted it would have to be one smart ars kid but I stand by my claim ;)
Okay, go into your library and select your Main MovieClip, go back to the gProject panel and select your Main.as class. Then click the dropdown icon at the top and navigate to Utilities>Update UI Elements and click on it.
gProject looks at the Main MovieClip and sees that it has an instance of TestObject in it. Further it sees that TestObject has a Class and then it imports, into Main.as the TestObject Class. Take a look at Main.as and you will see this:
// ** AUTO-UI IMPORT STATEMENTS **
import com.rezn8.ui.TestObject;
// ** AUTO-UI ELEMENTS **
private var testObject:TestObject;
So now you have access to TestObject. So in the constructor put this:
private function configUI():Void {
testObject._alpha = 50;
}
When you run the movie you will see that TestObject now has an alpha of 50%.
Thats it we're done.

