Hi
I’m trying to get some code working that Ayumilove from this forum once wrote for me for another project.
I have a panel movie clip that contains six buttons, this panel movieclip also contains a tool tip movie clip for each button, the tool tips just reside inside the panel movie clip not inside the buttons.
When the buttons are rolled over I want the tool tips to appear, alpha from 0 to 1 using Tweenlite.
Rather than repeating the event handler code I have used two arrays, one for the buttons and one for the tooltips.
So I need to tell flash that when button 2 for example is rolled over, make tool tip 2 appear. The code I have is below, I think I’m nearly there but this errors. Am I right to use switch?
Thanks
Ps
Please keep your answers fairly straight forward still learning.
import gs.TweenLite;
var buttonList:Array;
buttonList = [panel_mc.popular_btn, panel_mc.deluxe_btn, panel_mc.mates_btn, panel_mc.jubilee_btn, panel_mc.jubileewithHB_btn, panel_mc.jBed_btn];
var toolTipList:Array;
toolTipList = [panel_mc.toolTip1_mc, panel_mc.toolTip2_mc, panel_mc.toolTip3_mc, panel_mc.toolTip4_mc, panel_mc.toolTip5_mc, panel_mc.toolTip6_mc];
for(var i:uint=0; i < buttonList.length; i++)
{
nav1Mc*.addEventListener(MouseEvent.MOUSE_OVER, onButtonOver);
//nav1Mc*.addEventListener(MouseEvent.MOUSE_OUT, onButtonOut);
//buttonList[0].addEventListener(MouseEvent.CLICK, onButtonClicked);
}
function onButtonOver(event:MouseEvent):void
{
var currentToolTip:MovieClip;
switch(e.currentTarget)
{
case buttonList[0] : currentToolTip = toolTipList[0]; break;
case buttonList[1] : currentToolTip = toolTipList[1]; break;
//would repeat for all six if it was working
}
TweenLite.to(currentToolTip, 1, {alpha:1});
}