Posts tagged Tutorial
Button controlled smooth MC play/rewind
Jan 13th
1. Draw a square in the center of the stage.
Rectangle tool: turn off outline, click and drag on stage to draw.

2. Convert it to a movieclip symbol:
Right click on the square > convert to symbol > name: square_mc, “movieclip”, ok.

3. Add an invisible button inside square_mc.
Double click on the square_mc instance on the stage.
Create a new layer and call it “btn”.

With the button layer selected, draw another square or copy and paste the existing square.

Convert the shape to a button symbol called “invisible_btn”.

Double click on the button symbol you just made.
Select the “up” keyframe. Then click and drag the keyframe to the “hit” state.

Go back to the main timeline by clicking on “scene 1″ of the thread.
![]()
4. Create a short animation that will play (forward and reverse).
Select the movieclip instance on the stage.
Convert it to a movieclip symbol and call it “scale_square_mc”.

Double click on the movieclip to get to its timeline.
Create a motion tween by right clicking on the keyframe in the timeline and selecting “create motion tween”. (A 24-frame tween will automatically generate in the timeline).

Shorten the tween to 10 frames by clicking and dragging from the right edge of the tween.

With the play head on the 10th frame, use the transform tool (Q) to scale up the square. (Holding the shift key will preserve the proportion. Holding the option key will scale from the middle).

Note that a diamond keyframe appeared on the 10th frame in the timeline. You can make further adjustments to the tween using the motion editor palette.
We need to place a stop action at the end of the tween so that it doesn’t loop.
Create a layer and name it “stop”.
Right click on the 10th frame and select “insert keyframe”.

Select the keyframe.
In the actions palette, insert stop();
Note: a small “a” will appear in the timeline keyframe about the empty circle.
Go back to the main timeline (scene 1).
5. Label the instances (and the path to them) on the stage so that we can identify them in the code.
Select the movieclip on the stage.
In the properties palette, name it “scale_mc”.

Go to the “scale_square_mc” movieclip by double clicking on it on the stage.
![]()
Select the instance of “square_mc” on the stage.
In the properties palette, name it “square_mc”.

Go to the “square_mc” movieclip by double clicking on it on the stage.
![]()
Select the invisible button instance on the stage.
In the properties palette, name it “btn”.

Go back to the main timeline (scene 1).
6. Create a new layer and call it “actions”.

5. Select the actions layer frame and insert the following code using the actions palette:
//———–presets——————–
scale_mc.stop();
var rewind:Boolean = false;
//———–listeners——————–
scale_mc.addEventListener(Event.ENTER_FRAME,scaleRevFrame);
scale_mc.square_mc.btn.addEventListener(MouseEvent.ROLL_OVER,onScaleOver);
scale_mc.square_mc.btn.addEventListener(MouseEvent.ROLL_OUT,onScaleOut);
//———–functions——————–
function scaleRevFrame(event:Event):void{
if(rewind == true){
scale_mc.prevFrame();
}
}
function onScaleOver(event:MouseEvent):void{
scale_mc.play();
rewind = false;
}
function onScaleOut(event:MouseEvent):void{
rewind = true;
}
Note that there is a “var” (variable) named “rewind” in the presets. This allows us to use true/false statements (Boolean statements) to identify the condition of an instance. In other words, we can say something to the effect of, “If someone rolls over the square, then make it scale up. If someone rolls out of the square, turn it back off.”
In the listeners, we have an “ENTER_FRAME” event. It keeps track of what the movieclip instance “scale_mc” is doing.
The corresponding function for the “ENTER_FRAME” event has a conditional statement to execute. If the variable “rewind” is “true”, then go to the previous frame of scale_mc.
The other functions (onScaleOver and onScaleOut) essentially turn “rewind” on and off–they make the variable true or false. Rewind is false when someone rolls over scale_mc. Rewind is true when someone rolls out of scale_mc.
6. Save .fla and render.
The file should start with a static square in the middle. Roll over makes the square scale up smoothly, roll out makes it scale down smoothly.
ActionScript / by Rob Huddleston (2009)
Jan 4th
Visual learners can get up and running quickly on ActionScript programming skills for Flash CS4
If you’re a programmer who learns best when you “see” how something is done, this book will have you up and running with ActionScipt in no time. Step-by-step, two-page lessons show you the core programming foundations you must master to create rich Internet content using the preferred language for work with Flash. The visual approach breaks big topics into bite-sized modules, with high-resolution screen shots to illustrate each task.
You’ll learn such skills as how to add interactivity, animate in code, and work with external content to create Flash projects with pizzazz. Designed for visual learners, with two-page lessons and step-by-step, fully illustrated instructions Covers foundation ActionScript, animating, interactivity, and working with external content Demonstrates using the Actions panel, syntax rules, and essential language foundations Shows how to use variables and arrays; write functions, classes, if/else statements, and loops; and work with static classes such as Math Explores essential techniques such as loading visual aspects at runtime, text from delimited text files and XML, and server-based assets using Flash Remoting Companion Web site features all the code that appears in the text, ready to plug into your Web pages
“ActionScript: Your visual blueprint to creating interactive projects in Flash CS4 Professional” is the visual learner’s way to master ActionScript quickly and easily.
ActionScript 3.0: Classroom in a Book / by Adobe (2008)
Jan 4th
The fastest, easiest, most comprehensive way to learn ActionScript(R) 3.0 for Adobe Flash CS4 Professional ActionScript(R) 3.0 for Adobe Flash CS4 Professional Classroom in a Book contains 14 lessons. The book covers the basics of learning ActionScript and provides countless tips and techniques to help you become more productive. You can follow the book from start to finish or choose only those lessons that interest you. Learn to add interactivity to Flash files using ActionScript 3.0: Control timelines and animation, write event-handling functions, and control loading of and interaction with data, text, video, sound, and images. “The Classroom in a Book series is by far the best training material on the market. Everything you need to master the software is included: clear explanations of each lesson, step-by-step instructions, and the project files for the students.” -Barbara Binder, Adobe Certified Instructor, Rocky Mountain Training Classroom in a Book(R), the best-selling series of hands-on software training workbooks, helps you learn the features of Adobe software quickly and easily. Classroom in a Book offers what no other book or training program does-an official training series from Adobe Systems Incorporated, developed with the support of Adobe product experts.
Flash and Math: AS3 Tutorials
Jan 4th
Flash and Math was originally sponsored by NSF for the purpose of helping math and science educators create web-based teaching materials using Flash. Though the funded project ended in 2008, the team of professors continue to update the tutorial site. The site’s navigation is relatively dense, but the tutorials are worth searching and browsing through.



