I wrote my first class following Moock's Essential Action Script. I've added a couple of extra functions (the alpha change on click and the 'dragability' as well as the text field on each that displays the height) and then ran the class through a for... loop in a .fla file, resulting in a series of randomly sized, randomly placed boxes on the stage. If you refresh your browser the box sizes/placement/text will change.
As of now, the randomly generated numbers are variables in the .fla file and not the class. I thought that putting them in the class would limit the class somewhat, but now that i think about it:
if( h == undefined) {
height = Math.round(Math.random*1000)/2;
} else {
height = h;
}
On to chapter 5: Authoring an Image Viewer class
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment