Hi all,
I rendered a 3d cube spinning in different directions using cinema 4d. I imported the entire sequence into flash as a movie clip. My goal is to set up buttons that will take you to certain points of the cube sequence. i.e. frame 1 scene is top of cube-the user presses a button and the cube animates to a different side-information pops up.
Basically i have 3 buttons, they all animate the cube to different sides of it. I would like to animate back to the first side of the cube if the “home” button is pressed.
im attempting to use if else and currentFrame, but im having some trouble. I also tried using prevFrame(); instances when a button is pressed but didn’t know how to stop it when the cube got to a specific side.
Below is an example of my code. if anyone has better suggestions how to do this. or know whats wrong with my code i really appreciate it. thanks.
// start buttons
stop();
work_btn.onRelease = function() {
if (currentFrame == "start") {
_root.cube_mc.gotoAndPlay("mainWork");
}
if (currentFrame == "endContact") {
_root.cube_mc.gotoAndPlay("mainWork");
} else {
_root.cube_mc.gotoAndPlay("mainWork");
}
if (currentFrame == "profileEnd") {
_root.cube_mc.gotoAndPlay("profile");
} else {
_root.cube_mc.gotoAndPlay("mainWork");
}
};
contact_btn.onRelease = function() {
if (currentFrame == "start") {
_root.cube_mc.gotoAndPlay("mainContact);
}
if (currentFrame == "endContact") {
_root.cube_mc.gotoAndPlay("mainWork");
} else {
_root.cube_mc.gotoAndPlay("mainWork");
}
if (currentFrame == "profileEnd") {
_root.cube_mc.gotoAndPlay("profile");
} else {
_root.cube_mc.gotoAndPlay("mainWork");
}
};
profile_btn.onRelease = function() {
if (currentFrame == "start") {
_root.cube_mc.gotoAndPlay("mainProfile);
}
if (currentFrame == "endContact") {
_root.cube_mc.gotoAndPlay("mainWork");
} else {
_root.cube_mc.gotoAndPlay("mainWork");
}
if (currentFrame == "profileEnd") {
_root.cube_mc.gotoAndPlay("profile");
} else {
_root.cube_mc.gotoAndPlay("mainWork");
}
};