Saturday, February 19, 2011

DRAG AND DROP GAME

MAKE A DRAG AND DROP GAME WITH RESPONSES

STEPS:

1. Open a new flash file.

2. Name the first layer Background by double clicking on the text Layer 1 in the timeline and typing background.

3. On this layer, draw any of the elements of your game that do not need to be moved.

4. Once happy with your background elements, lock the layer by clicking on the dot underneath the lock on the background layer.

5. Create a new layer for the objects you want to be able to be dragged. You can make a layer for each object if you wish, though this is usually only necessary if you are going to animate the objects. On this new layer, draw the objects that are going to be dragged.

6. Once you have drawn your objects to be dragged, select each one individually and select Insert > Convert to Symbol. Ensure that you check the Movie Clip Behaviour option. Repeat this process for each of the objects that will be made draggable.

7. Make a new layer and name it response.

8. On this layer, you are going to create the movieclip symbols that will supply the user with the response. Draw what the user will see before they have dragged the object into the correct location.

9. Convert what you have drawn into a movie clip symbol by selecting it and choosing Insert > Convert to Symbol. Ensure you click the Movie Clip behaviour.

10. We are now going to set the movie clip up to have a second frame that Flash will go to when you are correct. To do this, click once on the movie clip symbol you just created and right click to bring up the context menu. From this menu, select Edit in Place.

11. You are now going to add a second keyframe to the movieclip symbol. To do this, click on the next frame and select Insert > Keyframe. In this keyframe, draw what you want the user to see when they get the object in the correct place.

12. Add a stop action to each keyframe by clicking on each keyframe in the timeline and typing stop(); in the Actions Panel.

13. To give your movie clips instance names, click on each one and type the instance name in the box shown in the left-hand side of the Properties Panel.

14. Select one of the movie clips that will be draggable.

15. Open the Actions Panel by pression F9.

16. Type or copy and paste the following actionscript into the panel.

on (press) {

startDrag(this);

}

on (release) {

stopDrag();

if ((this._x>=76.9) & (this._x<=132.6) & (this._y>=286.4) & (this._y<=337.5)) {

_root.checkbox1.gotoAndStop(2);

} else {

_root.checkbox1.gotoAndStop(1);

}

}

17. To make this script work in your game, you need to make some edits. I

have highlighted these in blue bold so it is clear what parts you need to change.

18. The second part of the script you need to change is the name of the movieclip instance that contains the 2 frames. In the script supplied above, the instance name is checkbox1— change both of the checkbox1 instances above to the instance name you used for your response movie clips.

19. Once you’ve edited your script, see if it works by selecting Control > Test Movie . If you get a response, you have followed all the instructions correctly, if not, double check that you have copied the script correctly, have entered the correct x and y coordinates and have made sure you have given the response movie clips instance names.

20. To complete your game, add and edit the actionscript for each of the draggable objects. Ensure that you have a response movie clip for each object that is being dragged.

21. Save your work by selecting File > Save.

22. Turn your flash file into a game that can be played on any computer by publishing it in different file formats. To do this select File > Publish Settings.

23. Tick the file formats you want and click on the Publish button.


TEXT ENTRY QUESTION


Saturday, February 12, 2011

MULTIPLE QUESTIONS

HOW TO MAKE A MULTIPLE CHOICES QUESTION.

STEPS:

1. Insert new layer and rename it as "soalan".

2. Type your question by using text tool and build your answer. You can make multiple choices of answers and convert them into button symbol. You also can duplicate one answer to make another answer in library.

3. Add a new layer and rename it as "stop". On 1st frame, right click and select Actions > global functions > time line control > stop.

4. Add a new layer and rename it as "correct". Now, we are going to make a result for the answer. Insert keyframe at frame 5 and draw your result as correct.

5. Add a new layer and rename it as "incorrect". Insert keyframe at frame 10 and draw your result as incorrect.

6. Next, select on layer "soalan", insert Actions for each of the buttons. (Select Actions>global functions> movie clip control>on>release. Then select global functions>time line control >gotoandplay> type frame 5 if the answer is correct and type frame 10 for incorrect answer.

7. Make sure that you insert stop action on layer correct and incorrect.

8. On layer "soalan" and "stop", insert new frame at frame 10.

9. Test your movie.





ENTRY TEXT

HOW TO MAKE A TEXT ENTRY .

STEPS:

1. Open a new file in Flash by selecting File > New.

2. Select the Text Box tool ( ) from the tool box and draw a text box on the stage.

3. In step 2, you created a text box. We are now going to convert this text box to an Input text box. This is the type of text box that the person using your game / flash file is able to type into.To do this, click on your text box, and then select the Input Text option from the Text Type drop down Menu.

4. The next step is to make this box a variable, to do this enter a name for your variable in the variable name cell. The variable name can be anything you like really, providing you remember it and enter the same name in the dynamic text boxes cell.

5. To enable the user to see the box where they will type in, ensure that the border tool button shown here is selected. At this point of the tutorial, you have set up an input text box and given it a border and a variable name. Usually when you work with input and dynamic text boxes, you display them in different frames or scenes. However, for the purpose of this tutorial, we are going to put the dynamic text box on the same frame as our input text box. Follow the steps below to do this.

6. Once again, select the Text Tool (T ) and draw another text box on the stage.

7. This text box needs to be a Dynamic Text box so we need to select the Dynamic Text option from our text types menu.

8. In the Variable Name Cell in the Properties panel, enter the same name you entered for the Input Text box.

10. You should now be able to check that your text boxes work by selecting Control > Test Movie. When you type your text into the input text box, you will see it appear in the dynamic text box.




Friday, February 11, 2011

SIMPLE INTERACTIVE ENVIRONMENT

MAKE A SIMPLE INTERACTIVE ENVIRONMENT WITH BUTTONS


STEPS:

1. Open a new file in Flash by selecting File > New.

2. In the timeline, you will see a layer that is named Layer 1. Double click on the name of this layer and type in background.

3. On this layer, import the background for your interactive environment.

4. Add a layer by selecting the Add New Layer button that is located at the bottom left hand corner of the timeline.

5. Double click on the text Layer 2 and rename it sheep1.

6. Click on the first keyframe on the sheep1 layer. Using the draw tools provided, draw your first object. (Alternatively, import your image by selecting File > Import). My object is a group of three sheep.

7. Select your object and press F8 to convert your object to a symbol. Type in the name of your object and ensure you select the button behavior option. Click OK.

8. Click on the object you just converted to a button and click your right mouse button to open up the context menu. Select Edit in Place from the menu.

9. You are now editing the button symbol. You will see that the timeline for this button symbol only has four frames—one for each of the button states.

The states are

UP - when the mouse isn’t over the button

OVER - when your mouse is over the button

DOWN - when you click your mouse on the button

HIT - the active area that is the button—the region the user can hit or roll over.

10. Add a keyframe to the Over state by selecting the frame under the word Over and selecting Insert > Keyframe from the menu.

11. Click on this new keyframe to ensure that it is the frame you are editing. Change your object to include the name or whatever you wanted to add or remove to make your object interactive.

In my example shown in video, I have simply added a text box containing the text ‘sheep’.

12. Add a keyframe to the Down state by selecting the frame under the word Down and selecting Insert > Keyframe from the menu.

13. Click on this new keyframe to ensure it is the frame you are editing. Change the object as required.

14. To add a sound to the Down state keyframe, you will need to select File > Import and then locate the sound you want from its location on your computer or network.

15. The sound you have imported in the previous step has not been applied to the button yet. Instead, it has been imported into the library within Flash. To open this library select Window > Library or press F11.

16. When you open the library, the Library panel shown here at the right will appear. Thesound file that you imported will be highlighted. To add the sound to your button, ensure thatthe frame underneath the down button state is still selected and click and drag the sound onto the stage.

17. You will be able to tell that the sound has been added to the frame because a blue horizontal line will appear across the frame. This is a graphical representation of the sound wave. Your button has now all of the features you need. Select the Scene 1 link

underneath the timeline to return to the main stage.

18. Your first interactive object is now ready for testing. Select Control > Test Movie from the menu to make sure it works.