Link to home
Start Free TrialLog in
Avatar of Melfeky
Melfeky

asked on

Rollover menu color os not changed when i added a link to it.

Hello ,
there is something i noticed, after i have added a link to the us/uk and france item menus and roll over with the mouse,its color is not changed like the other items in the menu which i didn't add link to.
here is a link to the intro:
http://bb.1asphost.com/nyehia/Multilanguage/rew_mx_file.html
i am pasting the code below, would u tell me what i am doing wrong, thanks.

this._lockroot = true;
cm = new ContextMenu();
cm.hideBuiltInItems();
_root.menu = cm;
MovieClip.prototype.__slideX = function(pos, velocity) {
      this.onEnterFrame = function() {
            if (this._x != pos) {
                  this._x = this._x+(pos-this._x)/velosity;
            } else {
                  this.onEnterFrame = null;
            }
      };
};
MovieClip.prototype.__slideY = function(pos, velocity) {
      this.onEnterFrame = function() {
            if (this._y != pos) {
                  this._y = this._y+(pos-this._y)/velocity;
            } else {
                  this.onEnterFrame = null;
            }
      };
};
this = createEmptyMovieClip("menuitems", 50);
this._x = 30;
this._y = 325;
with (this) {
      tab = attachMovie("tab", "tab0", 0);
      tab.btnlabel.text = "US/UK";
      tab._x = 0;
      tab.onRelease = function() { getURL("http://www.therealestatewinner.com","_blank") }
      tab = attachMovie("tab", "tab1", 1);
      tab.btnlabel.text = "France/Belgique";
      tab._x = 100;
            
      tab.onRelease = function() { getURL("http://www.therealestatewinner.com","_blank") }
            tab = attachMovie("tab", "tab2", 2);
      
      tab.btnlabel.text = "Deutchland";
      tab._x = 200;
      tab = attachMovie("tab", "tab3", 103);
      tab.btnlabel.text = "Nederland/Belgie";
      tab._x = 300;
      tab = attachMovie("tab", "tab4", 104);
      tab.btnlabel.text = "España";
      tab._x = 400;
      innerframe = attachMovie("innerframe", "innerframe", -1);
}
mask1 = attachMovie("mc_mask", "menumask", 51);
mask1._x = 10;
mask1._y = 275;
mask1._height = 33;
mask1._width = 720;
arrMb1 = new Array();
arrMb2 = new Array();
this.setMask(mask1);
this = createEmptyMovieClip("menuholder", 0);
mask2 = attachMovie("mc_mask", "menubgmask", 1);
mask2._x = 10;
mask2._y = 15;
mask2._height = 310;
mask2._width = 720;
arrMb1 = new Array();
arrMb2 = new Array();
this.setMask(mask2);
with (this) {
      for (var i = 0; i<12; i++) {
            mb = attachMovie("menuback", "menuback"+i, i);
            mb._x = 25;
            mb._y = 0;
            mb.__slideY(10+(25*i), 10);
            arrMb1.push(mb);
      }
      for (var i = 0; i<12; i++) {
            mb = attachMovie("menuback", "menuback"+(i+12), (i+12));
            mb._x = 25;
            mb._y = 285;
            mb.__slideY(285-(25*i), 10);
            arrMb2.push(mb);
      }
}
function initMenu() {
      for (var i = 0; i<arrMb1.length-1; i++) {
            arrMb1[i].__slideY(-30, 10);
      }
      for (var i = 0; i<arrMb2.length; i++) {
            arrMb2[i].__slideY(320, 10);
            if (i == 10) {
                  menuitems.__slideY(285, 11);
            }
      }
}
function showMenu() {
      menuitems.__slideY(285, 10);
}
Avatar of negatyve
negatyve

I can suppose that, inside each "tab" movieclip, there's a nested button. When you set the release handler to the external clip, you lose the inner button functions. So you should change your code to (supposing that the inner button instance name is "inner_btn"):

      // CHANGE HERE
      tab.inner_btn.onRelease = function()
      {
            getURL("http://www.therealestatewinner.com", "_blank");
      };
      tab = attachMovie("tab", "tab1", 1);
      tab.btnlabel.text = "France/Belgique";
      tab._x = 100;
      // CHANGE HERE
      tab.inner_btn.onRelease = function()
      {
            getURL("http://www.therealestatewinner.com", "_blank");
      };

besides that, you should not use "this" as a reference:

this = ....; // that's not correct, even if it works
Are these movieclips or button instances?
On movieclip instances you need to explicitly set the rollover action - like:
tab.onRollOver=function(){
this.gotoAndPlay("over");
}

...with over being a frame label in the mc of the 'over' frame, which should have a stop(); on it too, and also a frame/s for rollout, like:
tab.onRollOut=function(){
this.gotoAndPlay("rollout");
}
Billystyx
Avatar of Melfeky

ASKER

hello guys,
i did what you told me but it is not working.
i can send you the flash file to check it if you want.
thanks
>I can send you the flash file to check it if you want.

you should drop it on a public webserve, as private mailing is discouraged by EE guidelines, or try to describe how a tab movieclip is done.
ASKER CERTIFIED SOLUTION
Avatar of negatyve
negatyve

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Melfeky

ASKER

Thanks you negatyve , it got it and it works great.
:)