# \[FLASH 8\] Dueling Functions cancelling each other out

**URL:** https://forum.kirupa.com/t/flash-8-dueling-functions-cancelling-each-other-out/196456
**Category:** Uncategorized
**Created:** [August 8, 2006, 4:12pm UTC](https://forum.kirupa.com/t/flash-8-dueling-functions-cancelling-each-other-out/196456 "2006-08-08T16:12:03Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Peter71](https://avatars.discourse-cdn.com/v4/letter/p/13edae/32.png) [@Peter71](https://forum.kirupa.com/u/Peter71)
#### Post date: [August 8, 2006, 4:12pm UTC](https://forum.kirupa.com/t/flash-8-dueling-functions-cancelling-each-other-out/196456/1 "2006-08-08T16:12:03Z")

</div>

Hey everyone,

I am having difficulty with the following functions. What I want to do is just have one movie clip (we will call it plane\_mc) go up at an angle, and have another movie clip (oh, lets just call it fallingCan\_mc for kicks) that will go down at a particular angle. I got the plane to work fine with the following AS:

```auto

/* Plane motion script */
this.onEnterFrame = function () {
	/*Controls the plane motion to the left */
	if (this.plane_mc._x < 700) {
		this.plane_mc._x +=15;
	}
	
	/*Controls the plane motion up */
	if (this.plane_mc._y > -250) {
		this.plane_mc._y -=11;
	}
	
	/*Controls the plane height */
	if (this.plane_mc._height < 250) {
		this.plane_mc._height +=2;
	}
	
	/*Controls the plane width (2:5 ratio) */
	if (this.plane_mc._width < 150) {
		this.plane_mc._width +=5;
	}
}

```

But then when I added this code to the same Actions layer:

```auto

this.onEnterFrame = function () {
	/*Controls the can motion to the left */
	if (this.fallingCan_mc._x < 450) {
		this.fallingCan_mc._x +=1;
	}
	
	/*Controls the plane motion up */
	if (this.fallingCan_mc._y > 330) {
		this.fallingCan_mc._y +=5;
	}
	
	if (this.fallingCan_mc._x == 450) {
		this.fallingCan_mc._x -=2;
	}
	
	if (this.fallingCan_mc._y == 330) {
		this.fallingCan_mc._y -=1;
	}
}

```

It no workey. I tried the second function code on its own, and it didn’t work anyway, so I think it is tue culprit. Of course there could be some “Too many similar functions in the same Actions layer” rule that I don’t know about. Anyway, any help on this would be greatly appreciated by me and my precious falling cans…

Thanks in advance!
