| Hojomojo 2004-02-21, 12:28 pm |
| HI,
Im kinda new to this action script stuff and a friend of mine gave me some
code a while back to look at. Basically its a menu system with little moving
buttons. I've been tryin to understand it and have kinda worked out what bits
do what thought it might sound stupid i cant figure out how to assign a URL to
each button. As there all generated with action script im a bit confused.
Please help! Heres the code:
Movieclip.prototype.bouge = function(destY,destX){
this.acc = 8; this.dec = 1.8;
this.destY = destY; this.destX = destX;
this.currX = this._x; this.currY = this._y;
this.diffX = this.destX - this.currX;
this.diffY = this.destY - this.currY;
this.vx = (this.vx + (this.diffX) * 1 / this.acc) / this.dec;
this.vy = (this.vy + (this.diffY) * 1 / this.acc) / this.dec;
this.effet=(Math.abs(this._x-destX)/10);
this._alpha=100+effet;
this._yscale=40+effet;
this._xscale=40+effet;
this._x += this.vx;
this._y += this.vy;
updateAfterEvent();
}
function clic(n)
{
var index = Number(n.substring(1,2));
for ( var i=0; i<_root.nb; i++ ) {
if(index==q[i]){
var posit_clic=i;
}
}
for ( var i=posit_clic-1; i>-1; i-- ) {
_root.q[i+1]= _root.q[i];
}
_root.q[0]=index;
for ( var i=0; i<_root.nb; i++ ) {
_root.p[q[i]]=_root.r[i];
if ( i==index ) {
_root["a" add i].gotoAndStop(2);
_root["a" add i].swapDepths(20);
}
else
{
_root["a" add i].gotoAndStop(1);
}
}
}
//---- init ------
var nb=4;
var ecard = 90;
var p=new Array();
var r=new Array();
var q=new Array();
p[0]=50;
r[0]=p[0];
q[0]=0;
for ( var i=1; i<_root.nb; i++ )
{
_root.a0.duplicateMovieClip( "a" add i, i )
_root["a" add i].tx = "Nowt" add (i+1);
p[i]=p[0] + ecard*i;
r[i]=p[i] ;
q[i]=i;
}
_root.a0.tx="Home";
_root.a1.tx="Search";
_root.a2.tx="Groups";
_root.a3.tx="LogOut";
stop();
|