Code for animation in flash action script 2.0

In summary, the conversation is about dividing a board into 6 parts, with each part being equal to the size of the stage. The goal is to have the current part tween into the left, right, bottom, or top part when the mouse moves in that direction. The person has already made progress with the bar on the left, right, and bottom, but is unsure how to finish it. They are seeking help on how to use an invisible button and coding in Flash.
  • #1
brandy
161
0
i have a a board and i want it divided into 6 parts.
1 part is equal to the size of the stage.
when the mouse moves to the left of the screen i want the current part to tween into the left part.
same for right and down and up.

what i have so far is for the bar on the left, right, bottom.
on(rollOver){
...
something do to _x and _y?


how do i finish it?
please and thankyou.
 
Technology news on Phys.org
  • #2
I dont' really understand your question, but you can basically just set a point (x,y) that you want to be at. Then for your invisible button, you can have something like:
Code:
onRollOver() {
  mcSquare.nextFrame()
}
Then on one of the 6 squares, you have a stop command on the first frame, then on the second, you have something like:
Code:
onFrameEvent(enterframe){
dx = targetx - this._x
dy = targety - this._y
this._x =+ dx
this._y =+ dy
}
Sorry if the code is rusty, it's been years since I've coded or done anything in Flash.

For better reference, may I direct you to www.flashkit.com <-GREAT FORUM for Flash
 
  • #3


I am not an expert in coding or programming. However, I can provide some suggestions for completing the code for your animation in flash action script 2.0.

First, you will need to define the six parts of your board. This can be done by assigning each part a unique name or variable. For example, you can create a variable called "leftPart" and assign it to the left part of the board.

Next, you will need to use the "on(rollOver)" function to detect when the mouse moves over a particular part of the board. Within this function, you can use the "tween" function to animate the current part to the desired location. For example, if the mouse moves to the left of the screen, you can use the "tween" function to move the "currentPart" to the left part of the board.

You can repeat this process for the other directions (right, down, up) and assign different animations to each part. In order to ensure that the parts are equal in size, you can use the "stage.width" and "stage.height" functions to determine the size of the stage and divide it by six to get the size of each part.

Additionally, you may need to use the "on(rollOut)" function to reset the position of the parts when the mouse moves away from them.

I would also recommend researching and referencing online resources or tutorials for coding in flash action script 2.0 to get a better understanding of the syntax and functions used in this language.

I hope this helps and good luck with your animation project!
 

1. What is Action Script 2.0?

Action Script 2.0 is a programming language used for creating interactive and animated content in Adobe Flash. It is commonly used for web-based animations, games, and other multimedia applications.

2. How do I write code for animation in Flash Action Script 2.0?

The code for animation in Flash Action Script 2.0 is written using the programming concepts of variables, functions, and conditional statements. You can also use pre-made animation libraries or create your own custom animations using Action Script. It is recommended to have a basic understanding of programming concepts before attempting to write code for animation in Action Script 2.0.

3. Can I use Action Script 2.0 for 3D animation?

No, Action Script 2.0 is primarily used for 2D animation and is not capable of creating 3D animations. For 3D animation in Adobe Flash, you can use Action Script 3.0 or other software such as Adobe After Effects or Maya.

4. How can I make my animations interactive using Action Script 2.0?

Action Script 2.0 allows you to add interactivity to your animations through the use of event handlers and listeners. These allow you to create actions or responses based on user interactions, such as clicking on a button or hovering over an object.

5. Is Action Script 2.0 still relevant for creating animations?

While Action Script 2.0 is an older version of the language, it is still used by some developers for creating animations and games. However, Adobe no longer supports or updates it, so it may be more beneficial to learn newer versions such as Action Script 3.0 for more advanced and modern animation techniques.

Similar threads

  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
1
Views
3K
  • Programming and Computer Science
Replies
5
Views
1K
Replies
5
Views
1K
  • Programming and Computer Science
Replies
7
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
264
Replies
9
Views
1K
  • STEM Career Guidance
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
Back
Top