;

PDA

Click to See Complete Forum and Search --> : General scripting question


nofronts4
08-11-2005, 03:35 PM
Hi I am creating a circular interface that rotates around to specific points for the menu options. i have the circle key framed out to one complete rotation. when an option is selected i want the cirlce to rotate to that frame the stop. I dont want it to jump to the frame i want it to play the movie then stop on the frame. I have been trying scripts using the "if action" but i still can not get it to stop on the frame i want.

is there such an action like...

play
if (framenumber = 9) {
stop ();
}

Please let me know if anyone has any ideas i have been stuck on this for two weeks.

pellepiano
08-11-2005, 05:10 PM
I guess you have several buttons , and each one would make the wheel stop at a unique place in the timeline ?

I suggest you have something like this on a button

on(release){
whereToGo="gallery";
play();
}

...and on the frame where the wheel should stop for that button you have ...

if(whereToGo=="gallery"){
stop();
}

nofronts4
08-11-2005, 05:22 PM
I guess you have several buttons , and each one would make the wheel stop at a unique place in the timeline ?

I suggest you have something like this on a button

on(release){
whereToGo="gallery";
play();
}

...and on the frame where the wheel should stop for that button you have ...

if(whereToGo=="gallery"){
stop();
}


Is whereTOGO an actuall script or am i suspose to put info in this area. also what is gallery is it a frame lable or the name of a movie clip?
thanks for the response

pellepiano
08-11-2005, 07:34 PM
"whereToGo" is just a variable with a temporary value set by each button. I used this name of the variable just to describe its function ( where to end up in the timeline ). The value ( gallery ) is just a name , it could as well be "toasterbunny", but its more logical to use a name that corresponds to a section, button or whatever.

The principal is that you press a button, and the whereToGo variable gets a value. Each possible stop in the timeline should have the IF statement checking if the whereToGo variable has the value of that particular frame. And if it has, it should stop the playing.

nofronts4
08-12-2005, 10:24 AM
I have tried this script and it is working to an extent. This first button i click on goes to the correct frame exactley how i wanted it to. but each button after that just stops on the next key frame with a script. its weird though because what ever button you click first works perfect but then the second click just stops at the next script even if it is not the one that pertains to it. here is the code i have on the the first two buttons....

Button 1
on(press){
whereToGo="gallery";
play();
}
Coresponding frame
if(whereToGo1=="gallery1"){
stop();
}

Button 2
on(press){
whereToGo2="gallery2";
play();
}
Coresponding frame2
if(whereToGo2=="gallery2"){
stop();
}

Is this how this is meant to be set up? also should gallery be the name of a movie clip too? please let me know what you think. i can e-mail you this file if you like.

thanksk alan

pellepiano
08-12-2005, 01:36 PM
What the movieclip is called does not matter , as its the tweening that is moving the wheel.

the variable is general, so its called the same thing wherever its used. Its just its value that should change.

Button 1
on(press){
whereToGo="gallery1";
play();
}
Coresponding frame
if(whereToGo=="gallery1"){
stop();
}


Button 2
on(press){
whereToGo="gallery2";
play();
}
Coresponding frame2
if(whereToGo=="gallery2"){
stop();
}

You can use a more descripte value for the variable if you want. Like stop1 stop2 stop3 and so on.

nofronts4
08-17-2005, 03:59 PM
the rotation is working now but on the the variables are set the are causeing the movie to stop on every frame where the variables were set. i think that we need to rest them back to nothing after the frame is exited. but im not sure what i can set them to .

If I set them like this

on(press){
whereToGo2="gallery2";
play();
}

Can I unset them like this with a frame action?
{whereToGo2="null";
play();
}

Is there a sucf script as "on exit frame"? Let me know what you think.

alan

pellepiano
08-17-2005, 04:46 PM
I think you are doing this wrong. The variable name whereToGo should be the same all over. Dont number them . Its just the value that should change. Look at my example.