Thursday, January 17, 2008

Education of the Students, For the Students, By The Students

The title might be a little hookey, but it kind of captures the idea of what we are going for here. Yeager33 at MCTC actually "jumped into" Action Script 3 for flash. He worked through the approach and decided to create his own tutorial and share it on the wiki.

This is the first one.

Displaying a Block

  • 1. Open a new Flashfile(ActionScript 3.0)
  • 2. Create a rectangle and convert it to a movieclip
   Using the Rectangle tool create a new rectangle,Use selection tool and group the rectangle together
Right click the rectangle and select Convert to Symbol..
In the Convert to Symbol dialog box Enter Block in the Name: textfield
Select the radio button for Movie Clip
Click the Advanced button
Under Linkage select the Export for ActionScript checkbox
(this will also check the Export in first frame button Leave it checked)
Click Ok
ActionScript Class warning message box will pop up Select Ok

After converting to symbol make sure your stage is clear

  • 3. ActionScript Code

Select frame 1 right click and select Actions from drop down menu or press F9 to open Actions window In the Actions window type

  import flash.display.*;

This basically lets flash know that we will be working with display objects and events so it can load the code to handle these things.

  • Next we want to define a variable to represent our display object in this case the block we created
  var myBlock:DisplayObject= new Block()
  • At this point we have a variable(myBlock) representing our display object

We can now use ActionScript to alter the display object properties of our variable Let us set the starting point for myBlock before we draw it to the screen

  • Now we create myBlock on screen
  • Publish preview and you should now have a block sitting on screen at the (X,Y) position that you specified.

This may not seem like much right now, however we now have the ability to change properties of our object with ActionScript code

Go check out his page for the others.

1 comment:

Jenny Bardwell said...

I am finding that the best way to learn Flash is to read and view what others are doing. Whenever I get blocked and can't figure out what to do next, I go on my google reader and check out the progress that others are making. For instance, I heard that the Man High school students got a Flash book, so I went and bought one, too. I have found the book, Flash for Dummies, to be incredibly helpful, in small ways that I wouldn't have known how to ask help for. I want to thank everyone who has shared their fla files, who has shared their designs step by step, and who has answered my questions, when I have sent out a call for help. Don't hesitate to do this, yourself. It can save you much time and keeps the pleasure of designing alight.