What Is Flash?: Flash MX Hands-On Lab
What Is Flash?: Flash MX Hands-On Lab
1
Hands-On Tweening Examples of Tweening
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 ; };
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
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.