# Particle Class

**URL:** <https://forum.kirupa.com/t/particle-class/261693>\
**Category:** flash\
**Created:** [May 29, 2008, 11:24pm UTC](https://forum.kirupa.com/t/particle-class/261693 "2008-05-29T23:24:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![CantinaDan](https://avatars.discourse-cdn.com/v4/letter/c/7feea3/32.png) [@CantinaDan](https://forum.kirupa.com/u/CantinaDan)\
**Post date:** [May 29, 2008, 11:24pm UTC](https://forum.kirupa.com/t/particle-class/261693/1 "2008-05-29T23:24:15Z")

</div>

I’m trying to follow along with [Lynda.com](http://Lynda.com)’s “Building Particle Systems” lesson.

I’ve made a .as file with the following code:

```auto
package CustomClasses.Particle
{
	import flash.display.*;
	
	public class Particle extends Sprite
	{
		public xVelocity:Number;
		public yVelocity:Number;
		
		public function Particle()
		{
			xVelocity = 0;
			yVelocity = 0;
		}
		public function update():void
		{
			this.x += xVelocity;
			this.y += yVelocity;
		}
	}
}

```

I then made a Flash file with a movie clip and this code:

```auto
dot.xVelocity = 5;
dot.yVelocity = -1;

function updateBall(event:Event):void
{
	dot.update();
}

addEventListener(Event.ENTER_FRAME, updateBall);

```

When I try and preview the movie I keep getting errors even though I’ve copied exactly his code in the training video. These are the errors:

1071: Syntax error: expected a definition keyword (such as function) after attribute public, not xVelocity.  
1084: Syntax error: expecting rightbrace before semicolon.  
5000: The class ‘particle.Particle’ must subclass ‘flash.display.MovieClip’ since it is linked to a library symbol of that type.

Any help would be much appreciated!

---

<div class="post-metadata">

**Author:** ![rbnzdave](https://avatars.discourse-cdn.com/v4/letter/r/a587f6/32.png) [@rbnzdave](https://forum.kirupa.com/u/rbnzdave)\
**Post date:** [May 30, 2008, 2:59am UTC](https://forum.kirupa.com/t/particle-class/261693/2 "2008-05-30T02:59:45Z")

</div>

a fla feil would be a good start, aside from adding var i can’t see anything actually happening from the code supplied.
