# Button within movieclip

**URL:** <https://forum.kirupa.com/t/button-within-movieclip/21871>\
**Category:** Uncategorized\
**Created:** [May 27, 2003, 3:02pm UTC](https://forum.kirupa.com/t/button-within-movieclip/21871 "2003-05-27T15:02:24Z")\
**Posts on this page:** 8\
**Page:** 1

<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:** [May 27, 2003, 3:02pm UTC](https://forum.kirupa.com/t/button-within-movieclip/21871/1 "2003-05-27T15:02:24Z")

</div>

ok i am trying to control the variable “destination” from a button within the movie clip “scOne”. now when u click the button it should move the movieclip that is it in.(this is for navigation).  
now when i use the following script it doesn’t work  
[AS]  
on(release){  
this.destination = 200  
}  
[/AS]  
however just playing around i got the getURL statment to work  
[AS]  
on(release){  
getURL(“[www.kirupa.com](http://www.kirupa.com)”);  
}  
[/AS]  
now i can’t figure out why this is happening, is this becasue destination is not a built in function in flash? if the case then how would i refer to it via actionscript?

oh i forgot to mention that i am obviously using more than just that script for the postioning to move. not just destinatrion=200, i use this method all the time, but never liek the way i am now…

---

<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:** [May 27, 2003, 3:22pm UTC](https://forum.kirupa.com/t/button-within-movieclip/21871/2 "2003-05-27T15:22:04Z")

</div>

well of course destination is not a function!  
Do you want it to move horizontally or vertically?

---

<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:** [May 27, 2003, 3:32pm UTC](https://forum.kirupa.com/t/button-within-movieclip/21871/3 "2003-05-27T15:32:02Z")

</div>

well i already siad… that i know destination is not a function …  
my question is how to get around it. dotn worry about horizontally or vertically the script works, i just need to know how to refer to that actual variable

---

<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:** [May 27, 2003, 3:38pm UTC](https://forum.kirupa.com/t/button-within-movieclip/21871/4 "2003-05-27T15:38:00Z")

</div>

Problem of scope, obviously. What’s the rest of the script? And WHERE did you put the rest of your script?

---

<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:** [May 27, 2003, 3:47pm UTC](https://forum.kirupa.com/t/button-within-movieclip/21871/5 "2003-05-27T15:47:18Z")

</div>

ok i dont have the rest of the script with me, i can post when i get home. the rest of my script is in a movie clip on my main timeline. i tryed putting the movie clip in various locatiosn and still had the same problem.

---

<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:** [May 27, 2003, 4:07pm UTC](https://forum.kirupa.com/t/button-within-movieclip/21871/6 "2003-05-27T16:07:25Z")

</div>

[AS]  
on(release){  
this.destination = 200  
}  
[/AS]“this” refers to the timeline that contains the button, be careful.

---

<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:** [May 27, 2003, 4:18pm UTC](https://forum.kirupa.com/t/button-within-movieclip/21871/7 "2003-05-27T16:18:52Z")

</div>

[AS]  
on(Release) {  
destination == \_x  
//assuming scOne is on the main timeline  
\_root.scOne.desination == 200  
}  
[/AS]

dunno, might 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:** [May 27, 2003, 4:43pm UTC](https://forum.kirupa.com/t/button-within-movieclip/21871/8 "2003-05-27T16:43:39Z")

</div>

ilyaslamasse: i have tryed that from the get go and no good, this is why i am so confused on why this won’t work  
but thanks… 🙂  
hawk: that script looks good, i tryed to refer to scOne a different way and it did not work, i will try, thanks i think u might have got it.
