# Completley lost with movieclip-as-button actionscript

**URL:** <https://forum.kirupa.com/t/completley-lost-with-movieclip-as-button-actionscript/101878>\
**Category:** Uncategorized\
**Created:** [February 16, 2004, 9:55pm UTC](https://forum.kirupa.com/t/completley-lost-with-movieclip-as-button-actionscript/101878 "2004-02-16T21:55:22Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![cartoonfox](https://avatars.discourse-cdn.com/v4/letter/c/bb73d2/32.png) [@cartoonfox](https://forum.kirupa.com/u/cartoonfox)\
**Post date:** [February 16, 2004, 9:55pm UTC](https://forum.kirupa.com/t/completley-lost-with-movieclip-as-button-actionscript/101878/1 "2004-02-16T21:55:22Z")

</div>

hi, i was in new york last week, so i’m out of practice and cant seem to get this working.  
i have this code on a movieclip.

```auto
on (rollOver) {
	this.gotoAndPlay("in");
}
on (rollOut) {
	this.gotoAndPlay("out");
}
on (releaseOutside) {
	this.gotoAndPlay("out");
}
on (press) {
	gotoAndPlay("main-out");
	chosen = "_root.home";
}

```

the rollover and rollout actions work, its just that when i press, it doesnt goto frame labelled “main-out” (which is the next frame from where this code is). instead, it plays the rollout animation. 😕

someone over at flashkit reccommended this, but it still didnt work.

```auto
onClipEvent (load) {
	onRollOver = function () {
		this.gotoAndPlay("in");
	};
	onRollOut = onReleaseOutside=function () {
		this.gotoAndPlay("out");
	};
	onPress = function () {
		gotoAndPlay("main-out");
		chosen = "_root.home";
	};
}

```

can anyone help???

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:** [February 17, 2004, 12:23am UTC](https://forum.kirupa.com/t/completley-lost-with-movieclip-as-button-actionscript/101878/2 "2004-02-17T00:23:58Z")

</div>

hey sharif, chek your pm’s 😉

---

<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:** [February 18, 2004, 12:16pm UTC](https://forum.kirupa.com/t/completley-lost-with-movieclip-as-button-actionscript/101878/3 "2004-02-18T12:16:05Z")

</div>

To make it a little more clear, post your fla:)  
(or upload it, seems that the attachments are not working at the moment)

scotty(-:

---

<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:** [February 18, 2004, 5:03pm UTC](https://forum.kirupa.com/t/completley-lost-with-movieclip-as-button-actionscript/101878/4 "2004-02-18T17:03:08Z")

</div>

ok, here’s the url.  
[edit] resolved now

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:** [February 18, 2004, 7:00pm UTC](https://forum.kirupa.com/t/completley-lost-with-movieclip-as-button-actionscript/101878/5 "2004-02-18T19:00:40Z")

</div>

…Failed to open ducument…  
Is it mx2004?? Else try to zip it:)

scotty(-:

---

<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:** [February 18, 2004, 7:27pm UTC](https://forum.kirupa.com/t/completley-lost-with-movieclip-as-button-actionscript/101878/6 "2004-02-18T19:27:34Z")

</div>

_sigh_ this allways happens ☹

its mx (not 2004)

[edit] resolved now

which i doubt you can open.

thanks anyway.

---

<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:** [February 18, 2004, 8:05pm UTC](https://forum.kirupa.com/t/completley-lost-with-movieclip-as-button-actionscript/101878/7 "2004-02-18T20:05:01Z")

</div>

I’ve got it:)  
I’ll have a look.

scotty(-:

---

<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:** [February 18, 2004, 8:11pm UTC](https://forum.kirupa.com/t/completley-lost-with-movieclip-as-button-actionscript/101878/8 "2004-02-18T20:11:53Z")

</div>

I may have solved the problem, from the looks of it you had ‘scope’ issues all over.

Place this in frame 31 of ‘main’ mc:  
[AS]  
stop();  
trace(chosen);  
\_parent.gotoAndPlay(chosen);  
[/AS]

And this on the ‘home’ mc on frame 14 in ‘main’ mc:  
[AS]onClipEvent (load) {  
this.onRollOver = function () {  
this.gotoAndPlay(“in”);  
};  
this.onRollOut = this.onReleaseOutside=function () {  
this.gotoAndPlay(“out”);  
};  
this.onPress = function () {  
\_parent.chosen = “home”;  
\_parent.gotoAndPlay(“main-out”);

```
};

```

}[/AS]

---

<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:** [February 18, 2004, 8:13pm UTC](https://forum.kirupa.com/t/completley-lost-with-movieclip-as-button-actionscript/101878/9 "2004-02-18T20:13:37Z")

</div>

also you had a frame label of “main-end” and code targetting “main-out”. If you leave the label, change the code above to fit, if you leave the code, change the label.

---

<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:** [February 18, 2004, 8:47pm UTC](https://forum.kirupa.com/t/completley-lost-with-movieclip-as-button-actionscript/101878/10 "2004-02-18T20:47:19Z")

</div>

Well done, kill.robot:)  
I’m just too late…  
I almost had the same, only on frame 31  
[AS]stop();  
\_root.gotoAndPlay(chosen);[/AS]

scotty(-:

---

<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:** [February 18, 2004, 9:10pm UTC](https://forum.kirupa.com/t/completley-lost-with-movieclip-as-button-actionscript/101878/11 "2004-02-18T21:10:35Z")

</div>

cool, thanks everyone. see, i told you i was out of practice. 😃

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:** [February 18, 2004, 9:14pm UTC](https://forum.kirupa.com/t/completley-lost-with-movieclip-as-button-actionscript/101878/12 "2004-02-18T21:14:53Z")

</div>

excelent, works like a charm, except once it goes to the home section, the output window opens saying “home”.

but thanks, really appreciate it 🙂

---

<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:** [February 18, 2004, 10:33pm UTC](https://forum.kirupa.com/t/completley-lost-with-movieclip-as-button-actionscript/101878/13 "2004-02-18T22:33:55Z")

</div>

[AS]  
stop();  
trace(chosen); //\<-- take this line out…  
\_parent.gotoAndPlay(chosen);  
[/AS]

---

<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:** [February 19, 2004, 1:50pm UTC](https://forum.kirupa.com/t/completley-lost-with-movieclip-as-button-actionscript/101878/14 "2004-02-19T13:50:58Z")

</div>

oh ok, cool thanks 🙂
