Sunteți pe pagina 1din 9

Experiment Asam Basa

A relatively Asam compound when blue litmus paper turned red, but red litmus paper does not
change color. Meanwhile, a compound classified as "basa" when it turns red litmus paper into
blue, but blue litmus paper does not change color. A compound is said netraljika not change the
color of litmus paper.

1. Run Adobe Flash on Your Computer

2. Open File Kimia_AsamBasa_Latihan.fla

click open.. find Kimia_AsamBasa_Latihan.flaopen

3. Display work window Kimia_AsamBasa_Latihan.fla


4. Change the name of the layer 1 to layer objects. Object layer is provided for storing
objects movieclip such as container, litmus paper etc

5. Put the movie clip objects that are in the library to the stage and collated in the following
order

a. Find movieclip wadah_percobaan in the library

b. Drag movieclip wadah_percobaan to the stage


c. In the Properties pane, the contents of the instance name for the movieclip
"wadah_percobaan" with the name "wadah"

d. Find movie clip cairan in the library

e. Drag movieclip cairan and place it in the middle movieclip wadah


f. In the properties panel, fill instance name for movieclip cairan with the name
cairan

g. Repeat steps 5.a-5.c for other objects, put objects like the picture below and do not
forget to name the instance name for each object as follows

Objek Instance Name


Wadah_percobaan Wadah
Cairan Cairan
Botol_cuka Asamcuka
Botol_aquades Aquades
Wadah_sabun Sabun
Kertas_lakmus_biru Lakmusbiru
Kertas_lakmus_merah Lakmusmerah
Tombol_reset Reset
h. Object "wadah" that has been previously placed on the stage was blocked by the new
object "cairan

i. Right click object cairanarrangesend to Back

6. Give the name of each object with the Text tool in accordance with the picture below

7. .After all objects in the library have been put on the object layer. The next step is adding a
new layer to the action script.
a. In the timeline panel, click the insert layer
b. Give the name of the new layer with the name of the action
8. The next step is to give the script on the first frame of layer action
a. Right-click the layer frame 1 action click actions
b. Script window appear and write the following script
//deklarasi kordinat untuk tempat kembali objek
x_cuka = asamcuka._x;
y_cuka = asamcuka._y;

x_aquades = aquades._x;
y_aquades = aquades._y;

x_sabun = sabun._x;
y_sabun = sabun._y;

x_lakmusbiru = lakmusbiru._x;
y_lakmusbiru = lakmusbiru._y;

x_lakmusmerah = lakmusmerah._x;
y_lakmusmerah = lakmusmerah._y;

//deklarasi warna
warna_asamcuka = "0xCCCCCC"; //abu-abu
warna_aquades = "0x00CCFF"; //birumuda
warna_sabun = "0xFFCC99"; //merah muda
warna_biru = "0x0000FF";
warna_merah = "0xFF0000";
warna_kosong = "0xFFFFFF";

//deklarasi perubahan warna


warnacairan = new Color(cairan);
warnalakmusbiru = new Color(lakmusbiru);
warnalakmusmerah = new Color (lakmusmerah);

//variabel keadaan wadah


isi_wadah = "kosong";

//objek asam cuka


asamcuka.onPress = function(){
startDrag(this);
}

asamcuka.onRelease = function(){
stopDrag();
if(this._droptarget == "/wadah" and isi_wadah == "kosong"){
isi_wadah = "asamcuka";
warnacairan.setRGB(warna_asamcuka);
}
this._x = x_cuka;
this._y = y_cuka;
}

//objek aquades
aquades.onPress = function(){
startDrag(this);
}

aquades.onRelease = function(){
stopDrag();
if(this._droptarget == "/wadah" and isi_wadah == "kosong"){
isi_wadah = "aquades";
warnacairan.setRGB(warna_aquades);
}
this._x = x_aquades;
this._y = y_aquades;
}

//objek sabun
sabun.onPress = function(){
startDrag(this);
}

sabun.onRelease = function(){
stopDrag();
if(this._droptarget == "/wadah" and isi_wadah == "kosong"){
isi_wadah = "sabun";
warnacairan.setRGB(warna_sabun);
}
this._x = x_sabun;
this._y = y_sabun;
}

//objek lakmus biru


lakmusbiru.onPress = function(){
startDrag(this);
}

lakmusbiru.onRelease = function(){
stopDrag();

if(this._droptarget == "/wadah" and isi_wadah == "asamcuka"){


warnalakmusbiru.setRGB(warna_merah);
} else if(this._droptarget == "/wadah" and isi_wadah == "aquades"){
//Tidak ada perubahan warna
} else if(this._droptarget == "/wadah" and isi_wadah == "sabun"){
//Tidak ada perubahan warna
} else {
this._x = x_lakmusbiru;
this._y = y_lakmusbiru;
}
}

//lakmus merah
lakmusmerah.onPress = function(){
startDrag(this);
}

lakmusmerah.onRelease = function(){
stopDrag();

if(this._droptarget == "/wadah" and isi_wadah == "sabun"){


warnalakmusmerah.setRGB(warna_biru);
} else if(this._droptarget == "/wadah" and isi_wadah == "aquades"){
//Tidak ada perubahan warna
} else if(this._droptarget == "/wadah" and isi_wadah == "asamcuka"){
//Tidak ada perubahan warna
} else {
this._x = x_lakmusmerah;
this._y = y_lakmusmerah;
}
}

//tombol reset
reset.onRelease = function(){
isi_wadah = "kosong";
warnacairan.setRGB(warna_kosong);
warnalakmusbiru.setRGB(warna_biru);
warnalakmusmerah.setRGB(warna_merah);
lakmusbiru._x = x_lakmusbiru;
lakmusbiru._y = y_lakmusbiru;
lakmusmerah._x = x_lakmusmerah;
lakmusmerah._y = y_lakmusmerah;
}
Dragdrop
Dragdrop

S-ar putea să vă placă și