PDA

View Full Version : just a quick question


speedlemon
07-01-2004, 03:28 AM
some of you may have seen my other thread about a week ago in regards to a banner that i was making... well. i got that question answered but i ran into more trouble when i was completely baffled by why this script wasn't working the way i wanted. :mad:

ok. here's the code one of you helped me with + the part thats not working.(this part highlighted with red)

onClipEvent (load) {
right = true;
this._x = 50;
}
onClipEvent (enterFrame) {
if (right == true) {
this._x += 15;
if (this._x>=375) {
right = false;
}
}
if (right == false) {
this._x -= 15;
if (this._x<=25) {
right = true;
}
}
}
on (press) {
gotoAndStop(2);
}
ok. so if anyone could tell me why its not taking me to frame 2, i would *GREATLY* appreciate it, and i mean that!!!

thanks in advance, :D

FrankNtoad
07-01-2004, 04:00 AM
try _root.My_clip.gotoAndStop(2); if the button is in scene 1 and not in the clip

Ricod
07-01-2004, 07:42 AM
For future questions, it might be handier to use a more descriptive title. Some people tend to look at the titles to see wether or not they will be able to answer the question or something like that. (although it`s less likely in the Simple Stuff forum) It`s still better to use a more descriptive title.

speedlemon
07-01-2004, 06:39 PM
try _root.My_clip.gotoAndStop(2); if the button is in scene 1 and not in the clip
oh. i didnt even have a button to begin with. it was just a movie clip... i see. because before this i did drag and drop thing with just movie clips. well i couldve done it with buttons. but ill try that. ok. so ill edit the clip and make a button in it. is that what ill be wanting to do?? ok. hopefully i wont have anymore problems. :o

@ricod, sorry, ill remember to do that next time.



EDIT-

ok. i think i did what you suggested. i dont know what im doing wrong!!! :mad: maybe someone can take a look at it and tell me whats wrong with it...(see attachment.)

Bobbo171
07-01-2004, 07:18 PM
just use

on (press) {
_root.gotoAndStop(2);
}

instead of

on (press) {
gotoAndStop(2);
}

or

on (press) {
_root.My_Clip.gotoAndStop(2);
}

becuase _root will refer to the main timeline, and that is what you want to change

speedlemon
07-02-2004, 01:32 AM
thank you! i have finally solved this problem, and hopefully gained some knowledge that i can use in my future of actionscript! =D.

thanks again,
from erik ;)

Ricod
07-02-2004, 12:20 PM
No need to say sorry speedlemon ! It`s just one of the tips "to get faster, better answers". ;)