# In between?

**URL:** <https://forum.kirupa.com/t/in-between/17867>\
**Category:** Uncategorized\
**Created:** [April 10, 2003, 3:35am UTC](https://forum.kirupa.com/t/in-between/17867 "2003-04-10T03:35:54Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![liam](https://avatars.discourse-cdn.com/v4/letter/l/b9e5f3/32.png) [@liam](https://forum.kirupa.com/u/liam)\
**Post date:** [April 10, 2003, 3:35am UTC](https://forum.kirupa.com/t/in-between/17867/1 "2003-04-10T03:35:54Z")

</div>

im drawing a total blank here, and i can’t think straight. what i have on my movie is a little hand, and when the user drags the hand up and down, a corresponding movie clip goes to frame 2 in response to the \_y position of the hand movie clip.

what i can’t figure out is how to tell flash in my if condition that i want this to occur when the \_y position is between two values. how can i do this without writing a whole bunch of if/else/else if statements? what is the operator?

thanks in advance for any help!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 10, 2003, 3:43am UTC](https://forum.kirupa.com/t/in-between/17867/2 "2003-04-10T03:43:44Z")

</div>

if(mc.\_y\> 15 && mc.\_Y \<17){  
trace(“it works”);  
}

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 10, 2003, 3:45am UTC](https://forum.kirupa.com/t/in-between/17867/3 "2003-04-10T03:45:36Z")

</div>

thanks man 🙂 i tried something like that before but i’m so handicapped i couldn’t get it to work! :!:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 10, 2003, 3:57am UTC](https://forum.kirupa.com/t/in-between/17867/4 "2003-04-10T03:57:52Z")

</div>

😉 Happens to all of us.

Good night.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 10, 2003, 4:21am UTC](https://forum.kirupa.com/t/in-between/17867/5 "2003-04-10T04:21:12Z")

</div>

haha k, i got it to work when you drag the hand past one clip, but when i try to make it work when dragging it up and down past multiple things, it wont work, only one mc will go to the frame desired… i tried using variables to solve this, but it won’t help.

here is the code i tried:

[AS]/////////////////////////////  
// begin reveal properties//  
///////////////////////////  
onClipEvent (enterFrame) {  
about = this.\_y\>294 && this.\_y\<314;  
portfolio = this.\_y\>255 && this.\_y\<275;  
downloads = this.\_y\>217 && this.\_y\<237;  
contact = this.\_y\>179 && this.\_y\<199;

```
// for about
if(about){
	_root.navButtons_mc.gotoAndPlay(2);
}else{
	about = undefined;
	_root.navButtons_mc.gotoAndPlay(1);		
}

// for portfolio
if(portfolio){
	_root.navButtons_mc.gotoAndPlay(3);
}else{
	portfolio = undefined;
	_root.navButtons_mc.gotoAndPlay(1);		
}

// for downloads
if(downloads){
	_root.navButtons_mc.gotoAndPlay(4);
}else{
	downloads = undefined;
	_root.navButtons_mc.gotoAndPlay(1);		
}

// for contact
if(contact){
	_root.navButtons_mc.gotoAndPlay(5);
}else{
	contact = undefined;
	_root.navButtons_mc.gotoAndPlay(1);		
}

```

}[/AS]

This might be way out of line, but i thought it MIGHT work… lol… thanks for any help!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 10, 2003, 4:38am UTC](https://forum.kirupa.com/t/in-between/17867/6 "2003-04-10T04:38:17Z")

</div>

that wont work. The if statement can use the && , but you cant assign it the way you tried to assign in enterframe.

Im seeing triple right now. If no one has helped you by morning, I’ll give it a go…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 10, 2003, 4:40am UTC](https://forum.kirupa.com/t/in-between/17867/7 "2003-04-10T04:40:19Z")

</div>

hah thanks man 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 10, 2003, 1:55pm UTC](https://forum.kirupa.com/t/in-between/17867/8 "2003-04-10T13:55:30Z")

</div>

_bump_

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 10, 2003, 2:33pm UTC](https://forum.kirupa.com/t/in-between/17867/9 "2003-04-10T14:33:15Z")

</div>

Hey Liam… can you post your fla? It will save me some reconstructing time.

thanks.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 10, 2003, 8:13pm UTC](https://forum.kirupa.com/t/in-between/17867/10 "2003-04-10T20:13:42Z")

</div>

here it is:

Thanks C:-)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 10, 2003, 11:31pm UTC](https://forum.kirupa.com/t/in-between/17867/11 "2003-04-10T23:31:05Z")

</div>

k now i got it working for 2 rollovers, but it still doesnt work how i want it too!! 😠 haha well if you have a look at that .fla i hope it helps!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 11, 2003, 2:07am UTC](https://forum.kirupa.com/t/in-between/17867/12 "2003-04-11T02:07:28Z")

</div>

help montoya! 😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 11, 2003, 4:25pm UTC](https://forum.kirupa.com/t/in-between/17867/13 "2003-04-11T16:25:53Z")

</div>

liam… I looked at your code and Im having some trouble understanding it.

so, I changed the name of the hand movie clip to “hand” and of the navigation buttons to “nav”.

I deleted your code and I put the following on the main timeline.

```auto

alwaysx=hand._x;

hand.onPress=function(){
	this.startdrag();
	this.onenterframe=function(){
	mybox.text=this._x;
	if(this._x>_root.alwaysx || this._x<_root.alwaysx){
		this._x=_root.alwaysx;
	}
	if(this._y>292 && this._y <316){
		nav.gotoandstop(2);
	}else if(this._y>257 && this._y <276){
		nav.gotoandstop(3);
	}else if(this._y>217 && this._y <238){
		nav.gotoandstop(4);
	}
		}
	
}
hand.onRelease=function(){
	this.stopdrag();
}

```

Now, this may not be the cleanest and hasnt gone through extensive testing… but I think it reflects what you’re trying to do.

Have a great day.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 11, 2003, 6:39pm UTC](https://forum.kirupa.com/t/in-between/17867/14 "2003-04-11T18:39:38Z")

</div>

montoya -

thanks alot, it works perfectly! thanks for all your help. :P:P
