Help with mctween bttn action

Hello all,

I am using the mctween activated bttn. My bttns are looped and have been defined in a variable. I am trying to get specific onrelease functions such as loadMovie from each button in the loop depending on what bttn is clicked, but instead the onrelease functions is loading movies for all when any bttn in the loop is clicked.

Please help me with this. not really a guru yet in actionscript.


Heres my code.

// Includes the tweening extensions.#include “” // Assigns each button its own functions.// Of course, these buttons were created at design time, on the Flash IDE itself.// Usually, you wouldn’t do that with serious projects, you’d create them dinamically from some “template”// movieclip (or from some component).// This is an array, a list of the buttons used.var myButtons = [this.myButton_1, this.myButton_2, this.myButton_3, this.myButton_4, this.myButton_5, this.myButton_6];var myMovies = [this.movie1, this.movie2, this.movie3, this.movie4, this.movie5, this.movie6];// Loops on all buttons from the first to the last onefor (var i=0; i<myButtons.length; i++) { // Sets its original Y value. This will be used later for reference. myButtons*.originalY = myButtons*._y; // When the mouse rolls over this menu option… go down just a bit. // NOTICE: I’m not taking into consideration the problem of having the hit area going down and “moving” the // mouse area and out of the button (possible rollover flicking). This is just a simple example afterall. myButtons*.onRollOver = function() { this.tween("_y", this.originalY + 2, 2); }; // When the mouse exits the menu option… go back up. myButtons*.onRollout = myButtons*.onReleaseOutside = function() { this.tween("_y", this.originalY, 0.5); }; // When the mouse clicks… activate it! myButtons*.onRelease = function() { this._parent.activateItem (this); // *** Add some function here or somewhere else to handle real button actions! if (myButtons*== this.myButtons_2) loadMovie(“movie2.swf”, _root.c_meio.clips); if (myButtons*== this.myButtons_3) loadMovie(“movie3.swf”, _root.c_meio.clips); };}this.activateItem = function(item) { // Function that activates a button. // Checks if there’s an activated item already; if so, deactivates it. if (this.currentItem != false) this.deActivateItem(); // Activates it, finally this.currentItem = item; this.currentItem.alphaTo (100, 1); // makes it ‘disabled’ this.currentItem.enabled = false; // makes it a disabled button, so it won’t receive mouse events };this.deActivateItem = function() { // Deactivates the current activated menu item. this.currentItem.enabled = true; // back to a normal button/movieclip this.currentItem.alphaTo (60, 1.5); // back to its original opacity this.currentItem = undefined;};
I’m trying to make sure that if the user clicks, this.button_2 then this.button_2 will load movie2.swf alone not every movie for every bttn in the loop.

Thanks guys
[URL=“”] [URL=“”] [URL=“”] [URL=“”]