Learning English Online, Free English Lessons For Everyone
___ ______

Flash CS3: Lesson 1: Basics lesson about Drag-and-Drop in Flash CS3 PDF  | Print |  E-mail
Wednesday, 13 April 2011 15:46

Flash CS3: Lesson 1:  Basics lesson about Drag-and-Drop in Flash CS3

To illustrate drag-and-drop in ActionScript 3, we will first make some simple applications that involve dragging a circle on a rectangular board.

Each of the following examples have the following common code to draw a rectangular board on the stage and then add a circle as a child of the board. It might seem counterintuitive to build the relationships between myPoint, board, and stage before the graphics are added, but doing all of the "addChild" calls up front assures that the layering of the objects is exactly what we want. (The relationship between the board and the circle, though natural, can cause some issues with mouse events as we will see in a later tutorial.) Both of our objects are Sprites, with the "board" visually represented by a gray rectangle and the "myPoint" represented by a blue circle that is fairly large to illustrate some issues.

// Part 1 -- Setting up the objects

var board:Sprite = new Sprite();

var myPoint:Sprite = new Sprite();









board.x = 10;

board.y = 10;






myPoint.x = 50;

myPoint.y = 50;

__Please, Click here to have another Lesson about Drag-and-Drop in Flash CS3____

Last Updated on Wednesday, 13 April 2011 16:03

We have 52 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.