# Sliding Menu - need MC to play after sliding has finished

**URL:** <https://forum.kirupa.com/t/sliding-menu-need-mc-to-play-after-sliding-has-finished/184049>\
**Category:** flash\
**Created:** [April 1, 2006, 10:39am UTC](https://forum.kirupa.com/t/sliding-menu-need-mc-to-play-after-sliding-has-finished/184049 "2006-04-01T10:39:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chocito](https://avatars.discourse-cdn.com/v4/letter/c/65b543/32.png) [@chocito](https://forum.kirupa.com/u/chocito)\
**Post date:** [April 1, 2006, 10:39am UTC](https://forum.kirupa.com/t/sliding-menu-need-mc-to-play-after-sliding-has-finished/184049/1 "2006-04-01T10:39:53Z")

</div>

Hi,

I have created a Sliding Menu with about 12 sections. In one of the section/s I have a MC inside that I want to play. Is there a way to tell a MC to play once sliding has completed? Say based on pixel position (of the sliding MC) or something similar?

At the moment I’m using “on release” but with this method, the animation starts too early. (By the time you slide from section 1 to 12 the MC has already started playing)…

:hair:

Any ideas?

Thanks in advance!!

---

<div class="post-metadata">

**Author:** ![Henxon](https://avatars.discourse-cdn.com/v4/letter/h/51bf81/32.png) [@Henxon](https://forum.kirupa.com/u/Henxon)\
**Post date:** [April 1, 2006, 6:12pm UTC](https://forum.kirupa.com/t/sliding-menu-need-mc-to-play-after-sliding-has-finished/184049/2 "2006-04-01T18:12:24Z")

</div>

Start the inner movie from the last frame on the sliding mc with “theInnerMC.play()” where “theInnerMC” is the inner mc =)

Shold work I have understood the problem right…

If the sliding effect is done with AS it’s another issue, then it would help to know how…

/henxon:ko:

---

<div class="post-metadata">

**Author:** ![chocito](https://avatars.discourse-cdn.com/v4/letter/c/65b543/32.png) [@chocito](https://forum.kirupa.com/u/chocito)\
**Post date:** [April 2, 2006, 12:01am UTC](https://forum.kirupa.com/t/sliding-menu-need-mc-to-play-after-sliding-has-finished/184049/3 "2006-04-02T00:01:50Z")

</div>

## Hi, Thanks for the replay, it’s nice to get response so quickly. 😛 The Sliding Menu is done with AC, here is the code.

## [COLOR=Gray]//during the time the movie loads, we set the current //position of the content at 0,0; thus showing the //HOME section of the site.[/COLOR] onClipEvent (load) { \_x = 760; \_y = 0; div = 5; [COLOR=Gray] //This value just determines the speed //the transistions.[/COLOR] } [COLOR=Gray]//Here we constantly check for new values of // \_x and \_y. These values are determined by endX and endY. //We divide the difference by div to have an value that //continues to change until the equation is true. //Try changing the ‘enterFrame’ with ‘Load’ to see the //difference. You would then have to click on a button //several times before the transistion completes.[/COLOR] onClipEvent (enterFrame) { \_x += (endX-\_x)/div; \_y += (endY-\_y)/div; [COLOR=Gray] //We then use the onRelease method to determine the //new values of endX and endY. This is a new feature //in Flash MX.[/COLOR] \_root.NAV.Button01.onPress = function() { endX = 0; endY = 0; }; \_root.NAV.Button02.onPress = function() { endX = -760; endY = 0; }; \_root.NAV.Button03.onPress = function() { endX = -1520; endY = 0; }; \_root.NAV.Button04.onPress = function() { endX = -2280; endY = 0; }; }

What I want to do is to make the “theInnerMC” play once the sliding MC has moved to the \_X value. (eg. Button05 = -2280 pixels).

This Script is applied to the MC that is doing the sliding.

Thanks! :rambo:

---

<div class="post-metadata">

**Author:** ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)\
**Post date:** [April 2, 2006, 12:12am UTC](https://forum.kirupa.com/t/sliding-menu-need-mc-to-play-after-sliding-has-finished/184049/4 "2006-04-02T00:12:03Z")

</div>

I wouldn’t use that engine for the menu.

Use this one, it’ more dynamic:  
[http://www.n99creations.com/?pID=archives&col=Blue&arch=Sliding\_Menu\_with\_gotoAndStop](http://www.n99creations.com/?pID=archives&col=Blue&arch=Sliding_Menu_with_gotoAndStop)

Then it’s simply a matter of changin the code to:

```auto

var count:Number = 1;
var easeSpeed:Number = 6;
var val:MovieClip = but1;
while (_root["but"+count]) {
	_root["but"+(count)].id=count, _root["but"+(count++)].onPress=function () {
		val = _root["but"+this.id];
	};
}
ease.onEnterFrame = function() {
	this._x += (val._x-ease._x)/easeSpeed;
	Math.round(ease._x) == Math.round(val._x) ? page.gotoAndStop(val.id) : null;
};

```
