Stressed Out! Need Help!

I am trying to use the “Continuous Movement” tutorial on this web site. Actually, I am trying to adjust it to keep it from scaling and speeding up the movment of my objects. I merely want my objects to move across the screen at the same pace. Can someone help me with this? Please…

Hi Kelly.

onClipEvent(enterframe){
this._x++;
}

will make an object move constantly to the right.

I need to know more about what you’re trying to accomplish to help more. Also, Kelly (no offense at all), it would help us out if you use more descriptive subjects instead of using “Im stressed out”. I would suggest something like “problems with continuous movement” or something like that. :slight_smile: Thanks!

Let us know if we can help further.

Change your code to look like this…

onClipEvent (enterFrame) {
	//generating movement
	location = this._x;
	var i;
	i = 10
	if (this, hitTest(_root.block)) {
		this._x = -1000;
	} else {
		this._x = location+i++;
	}
}

Change the value i=10 to a higher number to make it go faster and a lower number to slow it down.

Good Luck:)

Hey lost… if you’re gonna give them that, you may as well explain the _root.block part of your code. I was giving her(?) a gentle nudge, since I don’t know exactly what she’s trying to achieve.

:slight_smile:

Hey Montoya, it sounds to me that she wants to achieve the continuous movement effect that kirupa uses by following the Continuous Movement tutorial. The problem is, in the tutorial, if you move your mouse up and down the shapes will scale up and down, and if you move your mouse left and right it speeds up and slows down. What I believe Kelly wanted was for a set speed without resizing.

The original code supplied by Kirupa is…

onClipEvent (enterFrame) {
	//generating movement
	location = this._x;
	var i;
	i = 1+_root._xmouse/5;
	if (this, hitTest(_root.block)) {
		this._x = -1000;
	} else {
		this._x = location+i++;
	}
	//clips are scaled according to y-mouse;
	this._xscale = 40+_root._ymouse;
	this._yscale = 40+_root._ymouse;
}

And what I said was to just change that code to look like this…

onClipEvent (enterFrame) {
	//generating movement
	location = this._x;
	var i;
	i = 10
	if (this, hitTest(_root.block)) {
		this._x = -1000;
	} else {
		this._x = location+i++;
	}
}

What this does is remove the parts that scale the clip and change the speed. Then the variable “i” is actually the speed. So in my example the speed is set to 10. As for the _root.block, that is just what kirupa used, so I figured if Kelly followed the same tutorial, she probably use the same instance name.

Hey there guys,

I just wanted to thank you for your help with this problem. I to manipulate the script from Kirupa, but for some reason no matter what I did it still would not work. I have not tried the script you provided yet, but I will later today. Once again thank you for helping me out.

P.S. I’m a guy…LOL!

No problem Kelly.

Sorry for thinking you were a girl, but we only had the name Kelly Nunes to go by, no other clues as to your gender. My apologies.

No worries, I actually think it’s funny. Everyone does that. I actually as assigned to the female dorms when I was is school and basic training in the Air Force because of my name. It was great until the girls found out about me…LOL!

Haha, that is quite humurous.

I remember my freshmen year in high school, our school was getting a new principal, his first name is Kelly and everyone thought he was going to be a she, then he showed up and we were all confused…haha.

I never read post with titles like this one, some others do, some don’t, it’s just too long to look through all those “i need help”, “urgent help”, “i give up”, “newbie needs actionscript hero” , or whatever else is meant to grab attention, it just doesn’t, state what you want/ what the problem is in the title, so everybody knows if it’s interesting, if they might know the answer, if they’d like the answer too etc…

And now I’m going to post that in all the other one’s with similar titles…beerdrinkers and hellraisers…(ZZ Top)…