Button within movieclip

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”);
}
[/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…

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

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

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

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.

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

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

dunno, might work

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… :slight_smile:
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.