The Theft Protection

Myths and Facts About Identity Theft


hallo i will share how to make puzzle in action script 3 and using adobe air so it will work for android too ok, here i have 9 picture object a bitmap this object that we will make into puzzle and i already save the fla with name puzzle.fla first, we make class for our puzzle.fla Click file>new>actionscript 3.0 then name the class same like the fla a puzzle after that click ok then save the class we save it in the same folder with puzzle.fla i save it in my untuk youtube folder(you can chose whathever you want) the Class is done first what we do is make all the object into movieClip before that i want to copy all the object to bottom this is for our object parts that dragable after that we make all the object into movieclip one by one then we name it “targetbagian1” if done we name the instance name “targetbagian1” for next object we name it “targetbagian2” click ok then name the instance name “targetbagian2” for more faster i just copy paste the name then change the number and 9, now we done for the drop target after we change it to movie clip i want to make transparent accents to the object like this, then we click style set the alfa we setting the alfa in here we adjust it in here we change it one by one now we done for the targetobject from 1 to 9, now we nake for the dragable object convert to symbol then name it Bagian1 the difference is if we name the object “targetbagian” now we name it just “Bagian” now its done, eventually i made a mistake in “Bagian” i use uoper case for “B” in “Bagian” i now must change “B” from “targetbagian” to uppercase all of them becase i will use the name for actionscript so use case is very important in here is there upper case or letter case the computer treated it as different ok its done we save it press ctrl+s, now if done all the “targetBagian” we done with it, now for the “Bagian” it is are not done yet we already make it to movie clip and name it, now we must put the code in the object to make it into dragable object now we make the class for “Bagian1” go to library click “Bagian1” right-click>properties and check export for actionscript, here we will make the class, just click the pencil image because we make the class from movgie clip then it already import MovieClip now we save it in the fla folder first we import the events function from flash library we want to drag it with mouseEvent so we must import the mouseEvent first now we can use the mouseEvent now we test it, here we can drag object Bagian1 but we cant drop it even i release the mouse and there is another problem when we drag the object on another object the object is get in behind we type addChild(this), why i type addChild(this) because when an object call with addChild this then the object automatically index on top its like we grab the object then we place it on top, and why i use parent becase who place the object is the parent in this case the stage parent is a stage and Bagian1 is child of the stage or we can call it parent now we try it now its fixed now lets make a drop function we add new listener for the drop fungtion and we use MOUSE_UP event and we change the fungtion name inmto DIDROP we make it lake DIDRAG function we delete this code then changet starDrag into stopDrag now its done, when the object we release the object will drop now its can be drop now the problem is a puzzle game have a feature like when we chose the right target then the object will automaticly fits the correct object its still not fits the object automaticaly now we make the code now we look at this in stop drag function here we put code trace(droptTarget.parent.name) now we test it the function for trace(dropTarget.parent.name) is to check where the object is dropped example we name it Bagian2 then its trace Bagian2 when we drop in Bagian3 then it wil trace Bagian3 it will read what object that get dropped in below and now why i tell you this, because we can use this to make the base code to make the object automatically fit to the target after that we put the code the use of if is to check if the objectTarget is equal to “target”+object name now we test it i put wrong code i forget to put + in there now we test it ups, its still have a wrong code the wrong is the cordinat x and y follow the stage not the object to solve this we must put parent in the code i think its not in front but in the middle now its correct now the problem is after we release the object its stilll can be dragable how to make the objeck is not dragable first we bake variable disable make it to Boolean now make a declaration of the variable now we make if statement in drag function if disable is false then the object can be dragable so when disable is true then DIDRAG function is not functioning lets we test it now its work to how it is, i click the object but it cannot dragable its done, now we must pass the function to another object to beome dragable like object Bagian1 the specialities of OOP in actionscript3.0 is we can pass a class to another class its called inheritance how to do that?, like this, its the done part its Bagian1 but i want to make this code from Bagian 1 is in another class object we cant just copy paste this code to another class because its not efficient when we must modify the code the good part of OOP is we can make 1 code to be use for any object example like this, we save as the class Bagian1 into another name here i change it to DragAndDrop class now we open class Bagian1, we erase al the code into an empty class now we just have to import the DragAndDrop class after we import, this class now have al the function in DragAndDrop class now extends Bagian1 as DragAndDrop now we test it i forget to change the public funcction and class to DragAndDrop now its done now we just have to make all the Bagian object have the same class now all the object already inherit from DragAndDrop class time to test it we test it one by one all done, here you can add a win screen or whatever u want ok maybe its all i can share today i hope its useful to you if u want request another tutorial you can comment bellow, and if you like this video please klik likes and if you want to know my newest update please subscribe maybe thats it and thanks for watching

2 thoughts on “Puzzle Game With AS3 in Flash CS6 – Flash Corner

  1. mas mohon maaf mau bertanya. itu kan puzzle runningnya kalo dijalankan dalam satu scene. nah andai kata saya membuat beberapa scene, lalu script dari class yang sudah dibuat saya simpan di folder yang berbeda, untuk importnya gimana yah agar bisa berjalan dengan banyak scene. terimaksih.

Leave comment

Your email address will not be published. Required fields are marked with *.