- Creating Sliding Panels for Navigation and Transition Effects
- Other Uses of the Slide Algorithm
- Multiple Mouse Slide
- Coding the Multiple Movement Algorithm
- Using Functions to Make Efficient Code
- Passing Parameters to Functions
- Duplicating the Movie Clip On-the-Fly
- Adding Scale to the Effect
- The Sliding Mask Transition Effect
- Creating the Function for X and Y Movement
- Adding to the Transition Effect
- Conclusion
Coding the Multiple Movement Algorithm
The brute-force way to make this work is to simply take your previous slide code, copy and paste the same code underneath the original code, and then alter this second part so that it affects the movie clip called panel2. As a result, you would end up with four if statements. That's reasonable when you only have two things to slide, but what if you had 5 or 10? What I want to do is show you a much more efficient way of coding this using something you will fall in love withfunctions.