Learning English Online, Free English Lessons For Everyone
_Sponsors_
___ ______

Tutorial to Learn Flash CS3


How to create a Hangman Game in Flash CS3 PDF  | Print |  E-mail
Thursday, 15 September 2011 17:15

Hangman is a popular game which can be coded using a few symbols and a short amount of code. The object of the game is to reveal a word by guessing the letters of the word one by one. The player loses by guessing 5 incorrect letters. A random answer is selected at the start of each game

Last Updated on Thursday, 15 September 2011 17:30
 
How to Create a Quiz with Free Quiz Template in Adobe Flash PDF  | Print |  E-mail
Wednesday, 14 September 2011 10:58

new from template

This article will demonstrate how to create a simple online quiz, complete with options for feedback, scoring and tracking, using free Flash quiz template in Adobe Flash. Please ensure you can manage to use Adobe Flash MX, Flash 8, Flash CS3, or Flash CS4 (http://www.adobe.com/products/flash/) before attempting this. If your are not an expert in Flash, QuizCreator from Wondershare can be the alternative program for you. This program will be referred at the ending of this page.

Last Updated on Wednesday, 14 September 2011 11:05
 
Lesson 1: How to Create a new Document In Adobe Flash CS3 PDF  | Print |  E-mail
Thursday, 28 July 2011 19:43
New Flash CS3 Document

See a higher quality video on lessonflash.com! A new document needs to be created in Adobe Flash CS3 before you can begin to create a flash movie. In this video tutorial, you will learn how to create a new document in Flash CS3. See higher quality tutorials all for FREE

Last Updated on Saturday, 31 March 2012 10:28
 
Table of Contents Lessons Adobe Flash CS3 PDF  | Print |  E-mail
Thursday, 28 July 2011 18:56
New Flash CS3 Document

See a higher quality video on lessonflash.com! A new document needs to be created in Adobe Flash CS3 before you can begin to create a flash movie. In this video tutorial, you will learn how to create a new document in Flash CS3. See higher quality tutorials all for FREE

Last Updated on Thursday, 28 July 2011 20:26
 
Drag and drop in AS3 part 3 PDF  | Print |  E-mail
Thursday, 14 April 2011 13:26

his is an addition to part 2 of the Drag and drop tutorial. In part 2 I modified the original code, so that multiple objects could use the same startDrag() and stopDrag() methods using the ‘event.target’ property. Since, then I have also created a drag and drop puzzle tutorial which also use the same functionality.

In this tutorial I will create a simple matching game using three targets and three draggable objects. In the game you match the draggable objects to the responding targets.


Drag and drop in AS3 part 3

Step 1

Open a new AS3 file. Then select the Rectangle tool and draw three targets on the stage like below. Convert each of the targets into movie clips (F8) with the centre registration point selected and give them the instance names: hitTarget1, hitTarget2 and hitTarget3 accordingly.



Step 2

Select the Oval tool and draw the draggable objects like below. Convert each of the targets into movie clips (F8) with the centre registration point and give them the instance names: drop1, drop2 and drop3 accordingly.




Step 3

On the timeline insert a new layer called ‘AS’ then open the actions panel and enter the following code:

//Array to hold the target instances, the drop instances,
//and the start positions of the drop instances.
var hitArray:Array = new Array(hitTarget1,hitTarget2,hitTarget3);
var dropArray:Array = new Array(drop1,drop2,drop3);
var positionsArray:Array = new Array();


//This adds the mouse down and up listener to the drop instances
//and add the starting x and y positions of the drop instances
//into the array.
for (var i:int = 0; i < dropArray.length; i++) {
dropArray[i].buttonMode = true;
dropArray[i].addEventListener(MouseEvent.MOUSE_DOWN, mdown);
dropArray[i].addEventListener(MouseEvent.MOUSE_UP, mUp);

positionsArray.push({xPos:dropArray[i].x, yPos:dropArray[i].y});
}

//This drags the object that has been selected and moves it
//to the top of the display list. This means you can't drag
//this object underneath anything.
function mdown(e:MouseEvent):void {
e.currentTarget.startDrag();
setChildIndex(MovieClip(e.currentTarget), numChildren - 1);
}

//This stops the dragging of the selected object when the mouse is
//released. If the object is dropped on the corresponding target
//then it get set to the x and y position of the target. Otherwise
//it returns to the original position.
function mUp(e:MouseEvent):void {
var dropIndex:int = dropArray.indexOf(e.currentTarget);
var target:MovieClip = e.currentTarget as MovieClip;

target.stopDrag();

if (target.hitTestObject(hitArray[dropIndex])) {
target.x = hitArray[dropIndex].x;
target.y = hitArray[dropIndex].y;
}else{
target.x = positionsArray[dropIndex].xPos;
target.y = positionsArray[dropIndex].yPos;
}
}

Here are some extras to spice up this game. I have created a button to reset the drop objects when they are all on the respective targets.

reset.addEventListener(MouseEvent.CLICK, backObjects);

function backObjects(e:MouseEvent):void{
for(var i:int = 0; i < dropArray.length; i++){
if(dropArray[i].x == hitArray[i].x && dropArray[i].y == hitArray[i].y){
dropArray[i].x = positionsArray[i].xPos;
dropArray[i].y = positionsArray[i].yPos;
}
}
}


I have also added a scream sound effect when the drag object is on the correct target. You will need to import a sound effect into the library then right click on the audio file and select properties, check the export to Actionscript button and give it a class name. For more information on sounds in Actionscript 3, checkout some of my audio tutorials.

function playSound(SoundName:Class):void{
var sound = new SoundName();
var channel:SoundChannel = sound.play();
}


To play the sound effect, add the following line of code inside the If statement of the mUp function.

playSound(TheNameOfTheClass);


Step 4

Test your movie clip Ctrl + Enter. You should now have a simple matching game.

Last Updated on Thursday, 14 April 2011 13:34
 
« StartPrev123456NextEnd »

Page 4 of 6
________


_____
We have 36 guests online

If you don't see anything in the middle of this page, you may need the latest Flash plug-in.
It only takes a few moments to
Download it FREE at Adobe.com. get adobe Flash player

Teaching English For Kids In Primary School

Stydying English Online For Everyone

Game for Kids


Home || Misterduncan|| Flash Cards || Songs For Kids|| Free Games || Learn English with GOGO|| Teaching English For Childern|| ESL/EFL Kids Course ||
Designed by Learning English Online. Designed by: Free Joomla Theme, mysql. Valid XHTML and CSS.