Properties

11 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$69.99
List Price:  $99.99
You save:  $30
€64.91
List Price:  €92.74
You save:  €27.82
£55.84
List Price:  £79.77
You save:  £23.93
CA$95.73
List Price:  CA$136.76
You save:  CA$41.03
A$105.88
List Price:  A$151.27
You save:  A$45.38
S$94.74
List Price:  S$135.35
You save:  S$40.60
HK$546.74
List Price:  HK$781.10
You save:  HK$234.35
CHF 63.47
List Price:  CHF 90.67
You save:  CHF 27.20
NOK kr758.86
List Price:  NOK kr1,084.13
You save:  NOK kr325.27
DKK kr484.32
List Price:  DKK kr691.91
You save:  DKK kr207.59
NZ$116.44
List Price:  NZ$166.35
You save:  NZ$49.91
د.إ257.06
List Price:  د.إ367.25
You save:  د.إ110.18
৳8,192.12
List Price:  ৳11,703.53
You save:  ৳3,511.41
₹5,845.24
List Price:  ₹8,350.71
You save:  ₹2,505.46
RM331.19
List Price:  RM473.15
You save:  RM141.96
₦101,684.97
List Price:  ₦145,270.47
You save:  ₦43,585.50
₨19,468.63
List Price:  ₨27,813.52
You save:  ₨8,344.89
฿2,574.93
List Price:  ฿3,678.63
You save:  ฿1,103.70
₺2,254.33
List Price:  ₺3,220.61
You save:  ₺966.27
B$360.86
List Price:  B$515.53
You save:  B$154.67
R1,285.96
List Price:  R1,837.17
You save:  R551.20
Лв126.94
List Price:  Лв181.36
You save:  Лв54.41
₩95,732.56
List Price:  ₩136,766.67
You save:  ₩41,034.10
₪261.33
List Price:  ₪373.34
You save:  ₪112.01
₱4,047.59
List Price:  ₱5,782.52
You save:  ₱1,734.93
¥10,909.97
List Price:  ¥15,586.34
You save:  ¥4,676.37
MX$1,171.54
List Price:  MX$1,673.70
You save:  MX$502.16
QR255.51
List Price:  QR365.03
You save:  QR109.52
P951.34
List Price:  P1,359.12
You save:  P407.77
KSh9,168.69
List Price:  KSh13,098.69
You save:  KSh3,930
E£3,292.89
List Price:  E£4,704.33
You save:  E£1,411.44
ብር4,020.45
List Price:  ብር5,743.75
You save:  ብር1,723.29
Kz58,375.85
List Price:  Kz83,397.65
You save:  Kz25,021.80
CLP$64,835.23
List Price:  CLP$92,625.73
You save:  CLP$27,790.50
CN¥506.35
List Price:  CN¥723.39
You save:  CN¥217.04
RD$4,074.29
List Price:  RD$5,820.67
You save:  RD$1,746.37
DA9,399.01
List Price:  DA13,427.73
You save:  DA4,028.72
FJ$158.92
List Price:  FJ$227.04
You save:  FJ$68.12
Q544.02
List Price:  Q777.21
You save:  Q233.18
GY$14,649.16
List Price:  GY$20,928.27
You save:  GY$6,279.10
ISK kr9,756.60
List Price:  ISK kr13,938.60
You save:  ISK kr4,182
DH701.90
List Price:  DH1,002.76
You save:  DH300.86
L1,242.81
List Price:  L1,775.52
You save:  L532.71
ден3,996.50
List Price:  ден5,709.54
You save:  ден1,713.03
MOP$563.52
List Price:  MOP$805.07
You save:  MOP$241.54
N$1,287.85
List Price:  N$1,839.87
You save:  N$552.01
C$2,577.61
List Price:  C$3,682.46
You save:  C$1,104.85
रु9,354.77
List Price:  रु13,364.54
You save:  रु4,009.76
S/258.41
List Price:  S/369.18
You save:  S/110.76
K271.72
List Price:  K388.19
You save:  K116.47
SAR262.50
List Price:  SAR375.02
You save:  SAR112.51
ZK1,916.71
List Price:  ZK2,738.27
You save:  ZK821.56
L323.04
List Price:  L461.50
You save:  L138.46
Kč1,610.16
List Price:  Kč2,300.33
You save:  Kč690.17
Ft25,114.33
List Price:  Ft35,879.15
You save:  Ft10,764.82
SEK kr760.20
List Price:  SEK kr1,086.05
You save:  SEK kr325.84
ARS$61,800.59
List Price:  ARS$88,290.35
You save:  ARS$26,489.75
Bs483.82
List Price:  Bs691.20
You save:  Bs207.38
COP$272,193.39
List Price:  COP$388,864.37
You save:  COP$116,670.97
₡35,883.99
List Price:  ₡51,265.04
You save:  ₡15,381.05
L1,730.53
List Price:  L2,472.30
You save:  L741.76
₲524,817.92
List Price:  ₲749,772.03
You save:  ₲224,954.10
$U2,694.96
List Price:  $U3,850.11
You save:  $U1,155.14
zł278.08
List Price:  zł397.28
You save:  zł119.19
Already have an account? Log In

Transcript

Hello, everyone. Welcome to this video tutorial brought to you by our Roja media. We are going to take a look at flash ActionScript, 3.0 and buttons. This is a simple tutorial that shows how to create a simple event listener for a button event. This is the final output we are going to create a ball changing its property values on button clicks. So to get started, get a new Flash file, draw a circle and convert it to a movie clip named object.

Each and every object should be given an instance name, which will be used in scripting. So go to the Properties panel and give it an instance name object underscore MC named the same to each layer two The very next thing we need is a button, which will change the object's property. Add a new layer as button, go to Windows menu components. In that below user interface option, you see a radio button available, select it and drag it to the main stage area. Level is the default text written on it. So, to change such properties, have it, go to Windows menu component inspector and change the label name to alpha.

Right now, it's not working as the action script is still not written for it. Give it an instance name, alpha underscore btn. add one more layer of action. This is the layer where we can attach action script for the buttons. Select Blank frame from action layer and press f9. To get action panel.

Let's write the function of the mouse event. The default value of the object instance is null. So it ends with a void. Between the open and closed curly brackets object should be introduced on which alpha property is supposed to set. And now the alpha value to be given it can be set between zero to one. For now, let's give the value of 0.5.

Now, let's add an event listener action for the alpha button to take the call. So that on its click movie clip manages its alpha value done Let's test the movie. It's working right. So we can see that we have written a right action script for the first alpha button. Moving ahead, similarly, we will add a button to change the movie clips x&y position. For that, drag one more button from the current Documents Library.

We will repeat the same procedure as done for the alpha button. change these buttons label to position from the component inspector. And for ActionScript purposes, give it an instance name as position underscore btn. Select the action layers frame and press f9 to open the Actions panel. Let's add the similar function and event listener for the position button. Here to the function will end with a void, which is undefined or default value of the object instance.

Then in the open and closed curly bracket to be changed x value of the object instance will be added. We choose 300 here, complete the action by giving an event listener for the position button. Let's test the movie now. Click and yes, the object is changing its position in the x direction. Even the alpha is working right now, let's add the value for the y position as well. All we have to add it between the curly brackets only write y equal to hundred and check the movie.

On the single click of the position button, the object is shifting to x as well as y values. Thus, we are successfully done with adding the position button and its actions. Let's add one more button to change the scale property of the object. Start with dragging the additional button on the stage from the library and changing its label to scale in the component inspector dialog box. Also, give it an instance name as scale underscore btn. Press f9 on the action layer to start with action scripting for the scale button.

Start with the function. The object can be scaled in both directions. That is x and y Let's add for this scale x direction first value to will multiply the object with to double in the x direction and add the action on the scale button. Test the movie now, pressing the scale button is changing the objects with to double. Similarly, we can add the scale value for y direction. Give the scale by equal to 1.5.

That is, in y direction, the object should stretch by one and a half times its original size. Control plus Enter to test the movie, and its scaling with the correct values applied in action for both x and y. So we finish with one more button action here. Let's add one more button to set the movie clips height and width. Change the new buttons label to height dash width and SW underscore btn as instance name. Hit f9 on action layer to add ActionScript we are keeping all the functions below each other.

And in the event listener action, a particular button is told to update Like exactly that particular function coming back, first we will add the width value for the object. Let's keep it 100. After adding the action for the button, test the movie you'll see that whatever default value may be of the object at that time, after clicking the height dash width button, its width is changing to exact hundred values. Let's go for the height value. To keep it the same, that is hundred, that's the movie. And yes, it's working perfectly is changing whatsoever current height and width of the object to exact hundred by 100.

That means we are done with the height dash width button ActionScript two. Let's add the last but not the least button, which will decide the visibility of the object. Drag a new button symbol on this stage on button layer and label it as visibility. Also name it visibility underscore btn as instance name in the Properties panel. Let's add the complete action for it and its function. Hear new debt, alpha and visibility.

Are two different functions. For alpha, you can apply any value in between zero to one. And for visibility, you decide the whole object should be totally visible or not. So, its property is set by only true and false value. Here, we have to totally hide the object. So set the visible value equal to false.

Add the event listener action to the button instance at the end. Test the movie for this object is hiding on one click. Thus, we have completed writing the action script for the object properties, play the movie clip, each button is functioning correctly. Similarly, you can experiment more and keep adding values or properties for an object. So, that's it for now. See you in the next lesson.

Thank you

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.