# Button issues while using Tween class code

**URL:** <https://forum.kirupa.com/t/button-issues-while-using-tween-class-code/184362>\
**Category:** Uncategorized\
**Created:** [April 4, 2006, 5:08pm UTC](https://forum.kirupa.com/t/button-issues-while-using-tween-class-code/184362 "2006-04-04T17:08:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![graylensman](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@graylensman](https://forum.kirupa.com/u/graylensman)\
**Post date:** [April 4, 2006, 5:08pm UTC](https://forum.kirupa.com/t/button-issues-while-using-tween-class-code/184362/1 "2006-04-04T17:08:36Z")

</div>

HALP! (and thanks in advance)

I’m using some Tween class motions activated by buttons. Here’s the swf:

[http://home.earthlink.net/~tacallender/showroom%20vfp%20Tweened.swf](http://home.earthlink.net/~tacallender/showroom%20vfp%20Tweened.swf)

when you click the green-circled button (the only one that works) a movie clip drops into place, with a photo showing. Click the buttons (photo, features, cross section) and the appropriate images show up. Click the “x” to close the window. Now click the green-circled button again. This time the photo does not appear, and clicking the buttons at the bottom does nothing. What’s going on?

Here’s the relevant code:

```auto

btnMMRA.onRelease = function() {
	releaseIt1();
	disableButtons();
	//call function to create swf holder in viewer unit
	makeSwfHolder();
	//initial swf insertion
	if (_root.viewnit.viewer.currMovie == undefined) {
		_root.viewnit.viewer.currMovie = "picMMRA";
		_root.viewnit.viewer.swfHolder.loadMovie("picMMRA.swf");
	}
	//call function to slide viewer into view    
	var dropScreen:Tween = new Tween(_root.viewnit.viewer, "_y", mx.transitions.easing.Elastic.easeOut, -540, 0, 20, false);
	dropScreen.start();
	//photo button function
	_root.viewnit.viewer.barHolder.bar.btnPhoto.onRollOver = function() {
		var bounceBtnP:Tween = new Tween(_root.viewnit.viewer.barHolder.bar.btnPhoto, "_y", mx.transitions.easing.Elastic.easeOut, 0, -14, 30, false);
		baunceBtnP.start();
	};
	_root.viewnit.viewer.barHolder.bar.btnPhoto.onRollOut = function() {
		var dropBtnP:Tween = new Tween(_root.viewnit.viewer.barHolder.bar.btnPhoto, "_y", mx.transitions.easing.Elastic.easeOut, -14, 0, 30, false);
		dropBtnP.start();
	};
	_root.viewnit.viewer.barHolder.bar.btnPhoto.onRelease = function() {
		if (_root.viewnit.viewer.currMovie == undefined) {
			_root.viewnit.viewer.currMovie = "picMMRA";
			_root.viewnit.viewer.swfHolder.loadMovie("picMMRA.swf");
		} else if (_root.viewnit.viewer.currMovie != "picMMRA") {
			if (_root.viewnit.viewer.swfHolder._currentframe>=swfHolder.midframe) {
				_root.viewnit.viewer.currMovie = "picMMRA";
				_root.viewnit.viewer.swfHolder.play();
			}
		}
	};
	//feature button function
	_root.viewnit.viewer.barHolder.bar.btnFeatures.onRollOver = function() {
		var bounceBtnF:Tween = new Tween(_root.viewnit.viewer.barHolder.bar.btnFeatures, "_y", mx.transitions.easing.Elastic.easeOut, 0, -14, 30, false);
		baunceBtnF.start();
	};
	_root.viewnit.viewer.barHolder.bar.btnFeatures.onRollOut = function() {
		var dropBtnF:Tween = new Tween(_root.viewnit.viewer.barHolder.bar.btnFeatures, "_y", mx.transitions.easing.Elastic.easeOut, -14, 0, 30, false);
		dropBtnF.start();
	};
	_root.viewnit.viewer.barHolder.bar.btnFeatures.onRelease = function() {
		if (_root.viewnit.viewer.currMovie == undefined) {
			_root.viewnit.viewer.currMovie = "featureMMRA";
			_root.viewnit.viewer.swfHolder.loadMovie("featureMMRA.swf");
		} else if (_root.viewnit.viewer.currMovie != "featureMMRA") {
			if (_root.viewnit.viewer.swfHolder._currentframe>=swfHolder.midframe) {
				_root.viewnit.viewer.currMovie = "featureMMRA";
				_root.viewnit.viewer.swfHolder.play();
			}
		}
	};
	//crossection button function
	_root.viewnit.viewer.barHolder.bar.btnCrossection.onRollOver = function() {
		var bounceBtnX:Tween = new Tween(_root.viewnit.viewer.barHolder.bar.btnCrossection, "_y", mx.transitions.easing.Elastic.easeOut, 0, -14, 30, false);
		bounceBtnX.start();
	};
	_root.viewnit.viewer.barHolder.bar.btnCrossection.onRollOut = function() {
		var dropBtnX:Tween = new Tween(_root.viewnit.viewer.barHolder.bar.btnCrossection, "_y", mx.transitions.easing.Elastic.easeOut, -14, 0, 30, false);
		dropBtnX.start();
	};
	_root.viewnit.viewer.barHolder.bar.btnCrossection.onRelease = function() {
		if (_root.viewnit.viewer.currMovie == undefined) {
			_root.viewnit.viewer.currMovie = "xscMMRA";
			_root.viewnit.viewer.swfHolder.loadMovie("xscMMRA.swf");
		} else if (_root.viewnit.viewer.currMovie != "xscMMRA") {
			if (_root.viewnit.viewer.swfHolder._currentframe>=swfHolder.midframe) {
				_root.viewnit.viewer.currMovie = "xscMMRA";
				_root.viewnit.viewer.swfHolder.play();
			}
		}
	};
	//close the viewer
	_root.viewnit.viewer.barHolder.bar.btnClose.onRollOver = function() {
		var bounceBtnC:Tween = new Tween(_root.viewnit.viewer.barHolder.bar.btnClose, "_y", mx.transitions.easing.Elastic.easeOut, 0, -14, 30, false);
		bounceBtnC.start();
	};
	_root.viewnit.viewer.barHolder.bar.btnClose.onRollOut = function() {
		var dropBtnC:Tween = new Tween(_root.viewnit.viewer.barHolder.bar.btnClose, "_y", mx.transitions.easing.Elastic.easeOut, -14, 0, 30, false);
		dropBtnC.start();
	};
	_root.viewnit.viewer.barHolder.bar.btnClose.onRelease = function() {
		var raiseScreen:Tween = new Tween(_root.viewnit.viewer, "_y", mx.transitions.easing.Elastic.easeIn, 0, -540, 20, false);
		raiseScreen.start();
		closeStuff();
	};
};

```

---

<div class="post-metadata">

**Author:** ![lunatic](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@lunatic](https://forum.kirupa.com/u/lunatic)\
**Post date:** [April 4, 2006, 5:56pm UTC](https://forum.kirupa.com/t/button-issues-while-using-tween-class-code/184362/2 "2006-04-04T17:56:32Z")

</div>

[ot] please wrap your code in [noparse]

```auto
 

```

[/noparse] tags to make it easier to read. thanks! 🙂 [/ot]

---

<div class="post-metadata">

**Author:** ![graylensman](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@graylensman](https://forum.kirupa.com/u/graylensman)\
**Post date:** [April 4, 2006, 6:19pm UTC](https://forum.kirupa.com/t/button-issues-while-using-tween-class-code/184362/3 "2006-04-04T18:19:34Z")

</div>

oops - thought I had. Here it is again! 🙂
