# Simple help with actionscript for game

**URL:** https://forum.kirupa.com/t/simple-help-with-actionscript-for-game/131449
**Category:** Uncategorized
**Created:** [December 15, 2004, 8:32pm UTC](https://forum.kirupa.com/t/simple-help-with-actionscript-for-game/131449 "2004-12-15T20:32:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![hotwireddriveby](https://avatars.discourse-cdn.com/v4/letter/h/97f17d/32.png) [@hotwireddriveby](https://forum.kirupa.com/u/hotwireddriveby)
#### Post date: [December 15, 2004, 8:32pm UTC](https://forum.kirupa.com/t/simple-help-with-actionscript-for-game/131449/1 "2004-12-15T20:32:36Z")

</div>

ok… im making a nav bar with a game attached. i want to have the character running around, and then you zap them. i have the whole button thing down, but i need help with the actionscript. i want the person to be moving slowly across the area, going back and forth at random heghts. this is what i have so far…

```auto
  onClipEvent (load) { 
  _root.hitz = 0; 
  this._alpha = 0; 
} 
onClipEvent (enterFrame) { 
  this._x -= _root.speedz; 
  this._rotation += 0; 
  if (this._x<=-80) { 
	this._alpha = 100; 
  } 
  if (this._x<=-380 && _root.hitz == 0) { 
	gotoAndPlay(2); 
	_root.missed += 1; 
	_root.hitz = 1; 
  }   
  if (_root._currentframe == 3) { 
	_parent.nextFrame(); 
  }   
} 

```

im new at this whole actionscript thing, so dont be suprised if i made a huge mistake. if its any help, im basin it off of this tutorial. [http://www.layoutgalaxy.com/html/htmnewletter47-page1.htm](http://www.layoutgalaxy.com/html/htmnewletter47-page1.htm)

thanks for looking.
