Home » Articles » FLASH TUTORIALS » ActionScript 2 (AS2) |
HOW TO CREATE A BOUNCING BALL FLASH AS2. Hallow funs! Here is the simplest method to design and coding the bouncing ball using Flash Actionscipt 2. After this tutorial you”ll have a realistic bouncing ball. But I recommend that you learn few articles about Flash Program in order to have basic knowledge of this Program just by clicking Here. If you have basic knowledge ready let’s go along as here under: Step 1: Open Adobe Flash which supports AS2. Step2: Design a ball using Oval Tool found in Tool menu. (press Ctrl +F2 to view or hide tools). Step 3: Change properties of your ball for your own preference. Step 4: Select the whole ball shape and convert it to symbol by simply pressing F8 key. The dialogue box will appear. Step 5: From Dialogue box, change the name of the symbol into the name you prefer to, and change registration to be Down, a registration point is the default location of an object from which an object's x and y co-ordinates are determined. Then press OK. See the picture below:
Click to View/Hide Image
" />
Step 6: Give the name of your MovieClip (MC) form the properties menu. . (press Ctrl +F3 to view or hide properties). See the picture below:
Click to View/Hide Image
" />
Now you have the instance of the ball on your stage. Step 6: Add some simple codes to your instance in order to make it live as follows:
Division 1. gravity = 5 onEnterFrame = function(){ ball._y+= gravity } By putting only the above code, the ball will fall but will neither stop nor bounce, test your movie to see just by pressing ENTER Key on your Keyboard. END OF PART ONE Click here for the Second part. | |
Views: 623 | |
Total comments: 0 | |