# Tooltip & gallery target same button instance confliction

**URL:** <https://forum.kirupa.com/t/tooltip-gallery-target-same-button-instance-confliction/251904>\
**Category:** Uncategorized\
**Created:** [February 13, 2008, 8:37pm UTC](https://forum.kirupa.com/t/tooltip-gallery-target-same-button-instance-confliction/251904 "2008-02-13T20:37:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dax1](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@dax1](https://forum.kirupa.com/u/dax1)\
**Post date:** [February 13, 2008, 8:37pm UTC](https://forum.kirupa.com/t/tooltip-gallery-target-same-button-instance-confliction/251904/1 "2008-02-13T20:37:25Z")

</div>

Found a useful tut on tooltip here which i’d like to integrate with a rollover expanding gallery that I purchased recently… but when I try to target the same button instance (s1\_btn) which is used in the Gallery AS the tooltip mc doesn’t function.

There appears to be a AS confliction when using ‘onRollOver’ cos if I change the Gallery code to ‘onRelease’ and leave the Tooltip AS as ‘onRollover’ everything works… but then you have to click on everything to view the content which is a little naf.

I’ve spent last night trying to figure out a solution but now seek some assistance. please see AS listed below

[COLOR=Blue]this is the Tooltip AS[/COLOR]

tooltip.\_visible = false;  
var tipInt;

[COLOR=Blue] s1\_btn[/COLOR].onRollOver = function() {  
tipInt = setInterval(showTip,100,“1966 world cup themed panels for a corporate box at Wembley”);  
}  
s1\_btn.onRollOut = function() {  
hideTip();  
}

var count = 0;

function showTip(tiptext) {  
if(count == 2) {  
clearInterval(tipInt);  
count = 0;  
tooltip.tiptext.text = tiptext;  
tooltip.\_x = \_root.SayfaM.content.cluster\_mc.cluster.\_xmouse;  
tooltip.\_y = \_root.SayfaM.content.cluster\_mc.cluster.\_ymouse;  
tooltip.\_visible = true;

```
    _root.SayfaM.content.cluster_mc.cluster.s1_btn.onMouseMove = function() {
    tooltip._x = _root.SayfaM.content.cluster_mc.cluster._xmouse;
    tooltip._y = _root.SayfaM.content.cluster_mc.cluster._ymouse;
        updateAfterEvent();
   }
}

else {
    count++;
}

```

}

function hideTip() {  
clearInterval(tipInt);  
tooltip.\_visible = false;  
delete \_root.onMouseMove;  
}

//////////////////////////////////////////////////////////////////

[COLOR=Blue]This is the Gallery AS[/COLOR]

//GALLERY SETTING

import mx.transitions.Tween;  
import mx.transitions.easing.\*;

//ACCORDION BUTTON CREAT

buttons = new Array([COLOR=Blue]s1\_btn[/COLOR], s2\_btn, s3\_btn, s4\_btn, s5\_btn, s6\_btn, s7\_btn, s8\_btn, s9\_btn);

var space:Number = 12;  
var ancho:Number = 41;

var oldX:Number;  
var newX:Number;  
var oldW:Number;  
var newW:Number;

//ACCORDION BUTTON CONTROLLER

handle\_menu = function () {  
newX = 0;  
for (var i:Number = 0; i \< buttons.length; i++) {  
oldX = buttons\*.\_x;  
new Tween(buttons\*, “\_x”, Strong.easeOut, oldX, newX, 1, true);

```
    if (buttons* == this) {
        
        newX += (this._width + space);
        newW = this._width;
        
    } else {
        
        newX += (ancho + space);
        newW = ancho;
    }
    oldW = buttons*.mascara_mc._width;
    new Tween(buttons*.mascara_mc, "_width", Strong.easeOut, oldW, newW, 1, true);
}

```

};

//ACCORDION BUTTON ACTIVE + ENABLE

button\_status = function (val:Boolean) {  
for (var i:Number = 0; i \< buttons.length; i++) {  
buttons\*.enabled = val;  
}  
};

//ACCORDION BUTTON HIT SETTING

var intervalId:Number;  
var hit\_area:Boolean = false;  
function executeCallback():Void {  
if (!this.hitTest(\_root.\_xmouse, \_root.\_ymouse)) {

```
    if (!hit_area) {
        
        ancho = 82;
        
        handle_menu();
        hit_area = true;
        button_status(false);
    }
} else {
    if (hit_area) {
        ancho = 41;
        hit_area = false;
        
        button_status(true);
    }
}

```

}  
intervalId = setInterval(this, “executeCallback”, 10);

for (var i:Number = 0; i \< buttons.length; i++) {  
buttons\*.onRelease = handle\_menu;

buttons\*.onRollOver = handle\_menu;  
[COLOR=Blue]///// If i change this to onRelease everything works!!! ////[/COLOR]  
}
