0% found this document useful (0 votes)
37 views5 pages

What Is Flash?: Flash MX Hands-On Lab

This document provides an overview of Flash and examples of using it to create animations and interactive elements. It discusses how to embed Flash files into HTML, the concept of tweening to create animations between keyframes, and examples of using ActionScript to control visibility and create simple calculators. Hands-on examples are provided for tweening, using ActionScript to control layer visibility, and building a calculator application to multiply quantities by prices and calculate totals.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views5 pages

What Is Flash?: Flash MX Hands-On Lab

This document provides an overview of Flash and examples of using it to create animations and interactive elements. It discusses how to embed Flash files into HTML, the concept of tweening to create animations between keyframes, and examples of using ActionScript to control visibility and create simple calculators. Hands-on examples are provided for tweening, using ActionScript to control layer visibility, and building a calculator application to multiply quantities by prices and calculate totals.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

What is Flash?

Flash MX Hands-on Lab.


Multimedia graphics program specially for
use on the Web
Quite Decent Java applet
Web based Visual Basic
CMSC434 Pretty Good Links
http://www.w3schools.com/flash/default.asp
http://www.actionscripts.org/tutorials.shtml
http://www.macromedia.com/devnet/mx/flash/

How to embed in HTML? Tweening

Make .fla file Comes from the words "in between"


Make .swf file
Goes from one keyframe to another and
Embed flash movie
<object width="550" height="400">
specify changes in the animation and let the
<param name="movie" value="somefilename.swf"> Flash program create the frames in between
<embed src="somefilename.swf" width="550" height="400">
</embed>
</object>

Or publish in Flash MX: File Publish

1
Hands-On Tweening Examples of Tweening

Create a small rectangle From


Select the rectangle and convert to symbol Learning_Flash.pdf
Go to 15th Frame and Insert Keyframe
Select the rectangle and move it
Go to 30th Frame and Insert Keyframe
Select the rectangle and move it
Right click on any timeline between keyframes
Create tween and run the movie (Control test)
Rotate the rectangle and embed it to HTML

ActionScript Hands-On Session AS(1)

Similar to JavaScript, VBScript Pre-steps


Read Unlock map layer
View Snapping
FL_Using_AS_in_Flash.pdf Ch. 2 Select Snap align, Snap to Object
FL_ActionScript_Ref.pdf : 1102 pages !!! Drag map_skewed from the Library Panel to GPS
Screen
Download Example2 from the class Link Name the map_skewed instance as screen_mc
page Unlock Button Layer
Name the green button as onButton_btn
Name the red button as offButton_btn

2
Hands-On Session AS(2) Hands-On Session AS(3)
Select Actions layer and open Actions panel
Push Insert a target path button and select screen_mc Check Syntax and test your application
Type . at the end of screen_mc , choose _visible and type = false
;
Push Insert a target path button and select onButton_btn
Type . at the end of onButton_btn , choose onRelease and type =
function() {screen_mc._visible = true ; }
Push Insert a target path button and select offButton_btn
Same as above except false for true

this.screen_mc._visible = false ;
this.onButton_btn.onRelease = function() { screen_mc._visible = true ; };
this.offButton_btn.onRelease = function() { screen_mc._visible = false ; };

Hands-On Session Calculator(1) Hands-On Session Calculator(2)

Download Example3 from the class Link page Declare variables, initialization and calculation
On Text fields Click actions layer and open Actions panel (F9)
Copy dynamic text fields for QTY area by alt-drag Enter the following statements
var priceCD = 320, priceShocks = 150, priceCover = 125 ;
Name them as qty1_txt , qty2_txt and qty3_txt from the
top Initialize input text fields
Do similar on the Price column with names price1_txt , qty1_txt.text = 0 ; qty2_txt.text = 0 ; qty3_txt.text = 0 ;
Write a function
Add a Button this.onEnterFrame = function() {
Select component layer price1_txt.text = Number(qty1_txt.text) * Number(priceCD) ;
Drag button control from the component window (ctrl + F7) price2_txt.text = Number(qty2_txt.text) * Number(priceShocks) ;
over the Calculate guide price3_txt.text = Number(qty3_txt.text) * Number(priceCover) ;
Change its name and label into calculate };

3
Hands-On Session Calculator(3) Run and call it a day

Write an event handler for the component


Select button and go to Actions panel
Enter Event Handler code
on(click) {
with (_parent) {
priceTotal_txt.text = Number(price1_txt.text)
+ Number(price2_txt.text)
+ Number(price3_txt.text) ;
}
}

4
This document was created with Win2PDF available at http://www.daneprairie.com.
The unregistered version of Win2PDF is for evaluation or non-commercial use only.

You might also like