Limit setting problem (FLA and SWF)

no more helpy?

I know you’re back now ElPooter, so let’s get continuing.

Argh! How is it that we are never on Kirupa at the same time! It is Frustrating!

Its ok, just post what to do next and ill respond with what ive got done after that. Then you can correct me and we can continue like that

Ok, Where did we leave off?

Scrolling and AI for the cop

Oh yeah :D. first, scrolling! Okay, scrolling is a bit more difficult then the other subjects that we have been working on. First, select the “char” again, and open his action panel. The next thing we will need is to set a scrolling speed, so in the “onLoad” we type the following:

 scrollspeed = 5;

Ok, first, we need to set a speed for the scrolling. Select the [color=red]char [/color][color=black]and ope the actions. Then type in his onClipEvent(load) { the following:[/color]

 scrollright = 5; 

then:

 scrollleft = 5; 

and then to control if he is scrolling or not, we add, under the first two, the following:

 scrolling = true; 

these will determine the speed for scrolling. Ok, now we start a new onClipEvent, and type the following for the scrolling right.

 
onClipEvent (enterFrame) {
if (scrolling) {
if (this._x>=250) {
// this says when he is at a certain area//
if (Key.isDown(Key.RIGHT)) {
this.moveRight = 0;
//this says that he cant move right//
this.moveLeft = 5;
//this says that he can move left//
_root.bg._x -= scrollright;
//this controls the backround to scroll right//
_root.cop._x -= scrollright;
//this controls the cop to scroll right//
_root.limits._x -= scrollright;
//this controls the limits to scroll right//
scrollleft = 5;
}
  } else {
   this.moveRight = 5;
  }
 }
}