---
title: "AS3抛物线运动"
author: "hacker47"
date: "2012-03-02T11:14:57Z"
tags: []
categories: ["Web前端"]
slug: "as3"
draft: false
lastmod: "2012-03-02T11:14:57Z"
id: 1435301
url: "https://hacker47.iteye.com/blog/1435301"
---

有些运动的效果用AS函数来实现，其实也挺有意思，回忆一下高中大学学过的数学和物理知识，就可以做出很多效果来。

 

 

 

 

 

```
package  
{
	import flash.display.MovieClip;
	import flash.events.Event;
	
	/**
	 * ...
	 * @author hacker47
	 */
	public class Main extends MovieClip 
	{
		private var ball:Ball;
		public function Main() 
		{
			ball = new Ball();
			ball.x = 10;
			ball.y = 10;
			addChild(ball);
			stage.addEventListener(Event.ENTER_FRAME, running);
		}
		
		private function running(e:Event):void {
			ball.x += 10;
			ball.y += 3;
		}
		
	}

}
```