Building on the earlier demo, add a subdirectory under src called oas2 (for Open ActionScript 2.0). Right click on the src folder: New -> Other... Then: General -> Folder. When the dialog appears, enter oas2 in the Folder name box. Click Finish.
Add a new ActionScript Class in the oas2 subfolder called Rectangle. Copy and paste this code. Save changes.
Open the main class file, Application.as. Two modifications are required.
- Above the class declaration:
import oas2.Rectangle ;
- At the bottom of the class constructor:
var my_rectangle:Rectangle = Rectangle.create(this, "my_rect", 50, 50, 25, 25) ;
No comments:
Post a Comment