# Controlling PAN

**URL:** <https://forum.kirupa.com/t/controlling-pan/126449>\
**Category:** Uncategorized\
**Created:** [October 23, 2004, 3:37pm UTC](https://forum.kirupa.com/t/controlling-pan/126449 "2004-10-23T15:37:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cki](https://avatars.discourse-cdn.com/v4/letter/c/85f322/32.png) [@cki](https://forum.kirupa.com/u/cki)\
**Post date:** [October 23, 2004, 3:37pm UTC](https://forum.kirupa.com/t/controlling-pan/126449/1 "2004-10-23T15:37:41Z")

</div>

Hi,

The following code, when attached to the MC panTracker\_mc works as desired, passing the value of the dynamic text field with a VARIABLE name of s1Pan to s1 sound object, thus controlling the pan.

```auto

onClipEvent (enterFrame) {
	s1Pan = Math.round(_root._xmouse/2.5)-100;
	_root.s1.setPan(s1Pan);
}

```

This code passes the value to the textField but does not control the s1 object

```auto

panTracker_mc.onMouseMove = function() {
	panTracker_mc.s1Pan = Math.round(_root._xmouse/2.5)-100;
	_root.s1.setPan(s1Pan);
};

```

I’m using 2004 MX Pro on MAC OS 10.2.8
