Ive been stuck on this idea for 2 weeks on and off.... this is the last piece of the website I have.... the links bit at top of page.... http://sail.joolo.com/test/
this is a swf of what I have done so far.... (its not final graphics of course but explains it (flash file attached!!))
each shade of blue is going to be a button.... when you roll over the white box will move to you mouse then open up more details of link.... when you move onto next colour the box will close and stay at the last point you rolled off it.... its a great effect if done!
the problem is ALL boxes want to move with mouse???... can someone help me? The script I think looks ok but has been cobbled together!
Hi
Check the fla attached, I think this is what you mean.
Feel free to use!
Stage size = 750 x 300
6 buttons(btn_1,btn_2...etc)
6 hovers (mc1,mc2...etc)
Code on main timeline.
code:
fscommand("allowscale", false);
for (i=1; i<7; i++) {
_root["btn_"+i].onRollOver = function() {
//trace(this._name);
id = this._name;
switch (id) {
case "btn_1" :
followMouse(btn_1, mc1, 0, 125);
break;
case "btn_2" :
followMouse(btn_2, mc2, 125, 250);
break;
case "btn_3" :
followMouse(btn_3, mc3, 250, 375);
break;
case "btn_4" :
followMouse(btn_4, mc4, 375, 500);
break;
case "btn_5" :
followMouse(btn_5, mc5, 500, 625);
break;
case "btn_6" :
followMouse(btn_6, mc6, 625, 750);
break;
//default = else do this
default :
//
}
};
}
function followMouse(btn, mc, xMin, xMax) {
var ypos = mc._y;
mc.gotoAndPlay(2);
onEnterFrame = function () {
if (_root._ymouse>0 && _root._ymouse<400 && _root._xmouse>xMin && _root._xmouse<xMax) {
ypos = _root._ymouse;
}
mc._y += (ypos-mc._y)/7;
if (mc._y<45) {
mc._y = 45;
}
if (mc._y>250) {
mc._y = 250;
}
btn.onRollOut = function() {
mc.gotoAndPlay(5);
if (_parent._xmouse<xMin || parent._xmouse>xMax) {
mc.gotoAndPlay(5);
}
delete onEnterFrame;
};
};
}
Sorry can I ask one more question then it should be done.....
Instead of the box shrinking down when you say roll off the botom of movie.... is there any way to keep it open until you rollover one of the rollovers again?