Kelompok II:
Nurjannah S. 140533600333
FAKULTAS TEKNIK
November 2016
LATIHAN
operation="no";
stop(); btntext=btntext+"2";
koma = 0; operator = 0;
angka = 1; }
btntext = ""; }
btn3.onRelease=function(){
reset.onRelease=function(){ if(angka == 1)
btntext=""; {
operation="no";
koma = 0; btntext=btntext+"3";
angka = 1; operator = 0;
operator = 1; }
awal = 1; }
}
btn4.onRelease=function(){
btn1.onRelease=function(){ if(angka == 1)
if(angka == 1) {
{
btntext=btntext+"4";
btntext=btntext+"1"; operator = 0;
operator = 0; }
} }
}
btn5.onRelease=function(){
btn2.onRelease=function(){ if(angka == 1)
if(angka == 1) {
{
btntext=btntext+"5"; btntext=btntext+".";
operator = 0; koma = 1;
} angka = 1;
} operator =
1;
btn6.onRelease=function(){ }
if(angka == 1) }
{ }
btntext=btntext+"6"; btntambah.onRelease=function
operator = 0; (){
} if(btntext!=""){
} if
(operation=="no") {
btn7.onRelease=function(){
if(angka == 1) btntext=btntext+"+";
{
operation="tambah";
btntext=btntext+"7"; koma = 0;
operator = 0; angka = 1;
} operator =
} 1;
}
btn8.onRelease=function(){ }
if(angka == 1) }
{
btnkurang.onRelease=function
btntext=btntext+"8"; (){
operator = 0; if(btntext!=""){
} if
} (operation=="no") {
btn9.onRelease=function(){
btntext=btntext+"-";
if(angka == 1)
{
operation="kurang";
koma = 0;
btntext=btntext+"9";
angka = 1;
operator = 0;
operator =
}
1;
}
}
}
btn0.onRelease=function(){
}
if(angka == 1)
{
btnkali.onRelease=function()
{
btntext=btntext+"0"; if(btntext!=""){
operator = 0; if
}
(operation=="no") {
}
btntitik.onRelease=function( btntext=btntext+"*";
){
if(btntext!=""){ operation="kali";
if (koma==0){ koma = 0;
angka = 1; if
operator = (operation=="no") {
1; btntext =
} Math.tan(btntext);
} koma = 0;
} angka = 1;
operator =
btnbagi.onRelease=function() 1;
{ }
if(btntext!=""){ }
if }
(operation=="no") {
btntext=btntext+"/"; btnsamadengan.onRelease=func
tion(){
operation="bagi"; if(btntext!=""){
koma = 0; if (operator !=1){
angka = 1; if
operator = (operation=="tambah") {
1;
}
} myArray=btntext.split("+");
}
btnsin.onRelease=function(){ number1=Number(myArray[0]);
if(btntext!=""){
if
(operation=="no") {
btntext = number2=Number(myArray[1]);
Math.sin(btntext);
koma = 0; total=number1+number2;
angka = 1;
operator = btntext=total;
1;
} operation="no";
} }
} if
(operation=="kurang") {
btncos.onRelease=function(){
if(btntext!=""){
if
myArray=btntext.split("-");
(operation=="no") {
btntext =
Math.cos(btntext);
koma = 0; number1=Number(myArray[0]);
angka = 1;
operator =
1; number2=Number(myArray[1]);
}
} total=number1-number2;
}
btntext=total;
btntan.onRelease=function(){
if(btntext!=""){
operation="no";
}
if
(operation=="kali") {
number1=Number(myArray[0]);
myArray=btntext.split("*");
number2=Number(myArray[1]);
number1=Number(myArray[0]); total=number1/number2;
btntext=total;
number2=Number(myArray[1]);
operation="no";
total=number1*number2; }
koma =
btntext=total; 1;
angka
operation="no"; = 0;
}
if operator = 1
(operation=="bagi") { }
}
myArray=btntext.split("/"); }
7. Kemudian enter dan hasilnya adalah seperti gambar di bawah ini.
5. Lalu buat layer kedua dan ganti nama menjadi garis koordinat.
6. Buat dua buah garis koordinat secara vertikal dan horizontal.
7. Setelah itu buat layer baru, dan ganti nama menjadi button.
8. Buat 3 buah button, dan beri masing-masing instance name-nya menjadi sin, cos, tan.
9. Dan ganti nama ketiga button juga menjadi Sin, Cos, dan Tan.
13. Letakkan lingkaran kecil tersebut di koordinat 0,0 seperti pada gambar.
sin.onRelease=function(){
sudut = 0;
grafik._x = 50;
grafik._y = 200;
tinggi = 2*43;
grafik.lineStyle(5, 0x041215);
grafik.onEnterFrame = function()
{
if (sudut < 360){
a = tinggi * Math.sin (sudut * Math.PI /180);
grafik._y = 200 - a;
duplicateMovieClip(grafik, "sinus" + sudut, sudut);
grafik._x++;
sudut++;
}
else {
stop();
}
}
}
cos.onRelease=function(){
grafik._x = 50;
grafik._y = 100;
sudut = 0;
grafik.onEnterFrame = function()
{
if (sudut < 360){
a = tinggi * Math.cos (sudut * Math.PI /180);
grafik._y = 200 - a;
duplicateMovieClip(grafik, "sinus" + sudut, sudut);
grafik._x++;
sudut++;
}
else {
stop();
}
}
}
tan.onRelease=function(){
sudut = 0;
grafik._x = 50;
grafik._y = 200;
grafik.onEnterFrame = function()
{
if (sudut < 360){
a = tinggi * (Math.sin (sudut * Math.PI /180))/
(Math.cos (sudut * Math.PI /180));
grafik._y = 200 - a;
duplicateMovieClip(grafik, "sinus" + sudut, sudut);
grafik._x++;
sudut++;
}
else {
stop();
}
}
}
TUGAS RUMAH
Pada preview kedua proyek animasi ini mulai memasuki awal cerita. Tampilan di atas
merupakan tampilan untuk perkenalan pembuat film animasi.
KESIMPULAN
Pada Adobe Flash terdapat fitur Action Script yang merupakan bahasa program yang
digunakan oleh Flash untuk memberikan perintah terhadap objek tertentu baik dalam
melakukan pergerakan maupun perintah lain. Pada praktikum ini, action script diterapkan
untuk operasi hitung bilangan dan dipadukan dengan pengkondisian if-else.
Berdasarkan praktikum yang telah dilakukan, praktikan mampu
mengimplementasikan fitur yang dimiliki Flash, baik dari segi grafis maupun action script.
Dari praktikum ini, praktikan mampu membuat animasi grafik dan kalkulator yang
memanfaatkan action script untuk perintah-perintah tertentu.