# gotoandPlay problems

**URL:** <https://forum.kirupa.com/t/gotoandplay-problems/65660>\
**Category:** flash\
**Created:** [September 28, 2004, 4:08pm UTC](https://forum.kirupa.com/t/gotoandplay-problems/65660 "2004-09-28T16:08:01Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![joesighting](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@joesighting](https://forum.kirupa.com/u/joesighting)\
**Post date:** [September 28, 2004, 4:08pm UTC](https://forum.kirupa.com/t/gotoandplay-problems/65660/1 "2004-09-28T16:08:01Z")

</div>

How do I tell a specific movieClip to gotoandPlay when I’m in another movieClip? I have tried defining the paths and I can get anything but gotoandPlay to work. I’ve posted .fla’s to illustrate what I can’t get done.  
Thanks,  
Joesighting

They are on another thread I posted.  
[http://www.kirupaforum.com/forums/showthread.php?t=71205](http://www.kirupaforum.com/forums/showthread.php?t=71205)

---

<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:** [September 28, 2004, 4:20pm UTC](https://forum.kirupa.com/t/gotoandplay-problems/65660/2 "2004-09-28T16:20:32Z")

</div>

posted where?

---

<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:** [September 28, 2004, 4:29pm UTC](https://forum.kirupa.com/t/gotoandplay-problems/65660/3 "2004-09-28T16:29:27Z")

</div>

double check that all your clips have instance names. Then start at \_root and set the path to your specific movie clip, for example

\_root.someclip.someotherclip.myspecificclip.gotoAndPlay(2);

:hr:

---

<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:** [September 28, 2004, 4:37pm UTC](https://forum.kirupa.com/t/gotoandplay-problems/65660/4 "2004-09-28T16:37:17Z")

</div>

Woops

They are on another thread I posted.  
[http://www.kirupaforum.com/forums/s...ead.php?t=71205](http://www.kirupaforum.com/forums/s...ead.php?t=71205)

---

<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:** [September 28, 2004, 4:50pm UTC](https://forum.kirupa.com/t/gotoandplay-problems/65660/5 "2004-09-28T16:50:32Z")

</div>

link doesn’t 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:** [September 28, 2004, 4:52pm UTC](https://forum.kirupa.com/t/gotoandplay-problems/65660/6 "2004-09-28T16:52:54Z")

</div>

[http://www.kirupaforum.com/forums/showthread.php?t=71205](http://www.kirupaforum.com/forums/showthread.php?t=71205)

---

<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:** [September 28, 2004, 6:54pm UTC](https://forum.kirupa.com/t/gotoandplay-problems/65660/7 "2004-09-28T18:54:54Z")

</div>

I have a main page (mainexample.swf) which has a button on it and an empty movieClip with an instance name of “content”.

The button’s script is

on (release) {  
loadMovie(“dragexample.swf”, “content”);  
}

It opens “dragexample.swf” into the empty movieClip “content”.  
Simple enough and it works fine.

Then “dragexample.swf” has two objects in it, a movieClip with the instance name of “circle” and a movieClip with the instance name of “square”.

The movieclip circle has a button in it with this script on it.

on (press) {  
startDrag("\_root.content.circle");  
}  
on (release) {  
stopDrag();  
if (\_root.content.circle.\_droptarget == “/square”) {  
\_root.content.circle.gotoandPlay(“shake”);  
}  
}

“shake” is referring to a frame label of the button which contains an animation to load when “circle” is dropped over “square”.

My problem is getting the script to carryout the “gotoandPlay” command, and I assume it has something to do with the paths.

Any help would be appreciated.

---

<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:** [September 28, 2004, 8:14pm UTC](https://forum.kirupa.com/t/gotoandplay-problems/65660/8 "2004-09-28T20:14:15Z")

</div>

This is nitpicky and you probably already have this but in your code above you wrote gotoandPlay when it should be gotoAndPlay (capital A in and).

Otherwise - did you try setting the entire path for square?

I don’t have flash here so can’t look at your file. ☹

---

<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:** [September 28, 2004, 8:37pm UTC](https://forum.kirupa.com/t/gotoandplay-problems/65660/9 "2004-09-28T20:37:50Z")

</div>

Ok so I figured it out finally, with the help from a cousin of my brothers friend who is a programmer. LOL We took a different approach, but it works perfectly. I thought I’d post it in case anybody might need it.

on (press) {  
\*unloadMovieNum(1);  
\*startDrag(this);  
}  
on (release) {  
\*stopDrag();  
\*if (this.\_droptarget.indexOf("/square") \>= 0) {  
\*\*gotoandPlay(“shake”);  
\*}  
}

The reason I do a .indexOf("/square") … is because the actual value is probably something like content/square … but since i don’t know exactly what it is, this works.\* Also, all that “root.content.circle” stuff didn’t ever seem to work for me, so I changed it to “this” … that way it is a relative object and it won’t matter what context it is in.

Thanks to everybody who gave me input.

Joesighting
