# Please help!

**URL:** <https://forum.kirupa.com/t/please-help/174339>\
**Category:** Uncategorized\
**Created:** [January 4, 2006, 9:10pm UTC](https://forum.kirupa.com/t/please-help/174339 "2006-01-04T21:10:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bobbywong03](https://avatars.discourse-cdn.com/v4/letter/b/dec6dc/32.png) [@bobbywong03](https://forum.kirupa.com/u/bobbywong03)\
**Post date:** [January 4, 2006, 9:10pm UTC](https://forum.kirupa.com/t/please-help/174339/1 "2006-01-04T21:10:27Z")

</div>

Hi Guys,

I have a flash page and I want to creat a link that will go to Panini/ Sandwich page Which is the third button but it seems like I am having a hard time trying to linking to that page please help…here is the source…

/\* ---------------------------------------------------------------------------------  
© 2003 Armen Abrahamyan  
[http://abrahamyan.com](http://abrahamyan.com)  
[armen@abrahamyan.com](mailto:armen@abrahamyan.com)

Please contact Author for commercial use.

armScroll component.  
version 1.0

methods :

setSize(w,h)  
set\_target\_mc(mc)  
set\_scroll\_buffer(buffer)  
set\_scroll\_cnt(cnt)  
set\_speed(speed)

* * *

\*/

#initclip

function armScroll(){  
this.init();   
}  
armScroll.prototype = new MovieClip();  
Object.registerClass(“armScroll”,armscroll);

// init  
armScroll.prototype.init=function(){  
this.target\_xpos=eval(this.target\_mc).\_x  
this.target\_ypos=eval(this.target\_mc).\_y

```
this.mask_mc.removeMovieClip();
this.attachMovie("bg_mc","bg_mc",2)
this.add_buttons(this.s_cnt)

this.componentWidth= this._width
this.componentHeight= this._height
 
this._xscale=this._yscale=100
this.setSize(this.componentWidth,this.componentHeight)

//

this.boundingBox._visible=false
// mask
this.createRect("mask_mc",0 , 0, this.scroll_buffer, 400, 0x333333, 0x333333,3) 
this.point = new object();
this.point.x = eval(this.target_mc)._x
this.point.y =eval(this.target_mc)._y
this.globalToLocal(this.point);
this.mask_mc._x=this.point.x
this.mask_mc._y=this.point.y
eval(this.target_mc).setMask(this.mask_mc)

```

}  
// setSize  
armScroll.prototype.setSize=function(w,h){

```
this.componentWidth= Math.round(w)
this.componentHeight=Math.round(h)
this.boundingBox_mc._width= Math.round(w)
this.boundingBox_mc._height= Math.round(h)
this.bg_mc._width= Math.round(w)
this.bg_mc._height= Math.round(h)

var b_w=(this.bg_mc._width-this.prev_btn._width-this.next_btn._width-4*(this.s_cnt+3))/this.s_cnt

this.prev_btn._x=4
this.next_btn._x=this.bg_mc._width-this.next_btn._width-4
this.next_btn._y=(this.bg_mc._height-this.next_btn._height)/2
this.prev_btn._y=(this.bg_mc._height-this.prev_btn._height)/2

for (var i=1;i&lt;=this.s_cnt;i++) {
	this["button_mc"+i]._width=b_w
	this["button_mc"+i]._y=(this.bg_mc._height-this.button_mc1._height)/2
	this["button_mc"+i]._x=this.prev_btn._width+(this.button_mc1._width)*(i-1)+(i+1)*4	
}

```

}

// add buttons  
armScroll.prototype.add\_buttons=function(cnt){  
this.attachMovie(“button\_next\_mc”,“next\_btn”,4)  
this.attachMovie(“button\_prev\_mc”,“prev\_btn”,5)  
//next button  
this.next\_btn.ref=this  
this.next\_btn.useHandCursor=false  
this.next\_btn.onPress=function(){  
if(!this.ref.is\_move){  
this.xpos=eval(this.ref.target\_mc).\_x \> (this.ref.target\_xpos-(this.ref.s\_cnt-1)\*this.ref.scroll\_buffer) ? (eval(this.ref.target\_mc).\_x-this.ref.scroll\_buffer) : eval(this.ref.target\_mc).\_x  
this.ypos=eval(this.ref.target\_mc).\_y  
this.ref.move\_sl(eval(this.ref.target\_mc),this.xpos,this.ypos,this.ref.speed)  
}  
}  
this.next\_btn.onRollOver=function(){  
this.nextFrame()  
}  
this.next\_btn.onRollOut=function(){  
this.prevFrame()  
}  
//prev button  
this.prev\_btn.ref=this  
this.prev\_btn.useHandCursor=false  
this.prev\_btn.onPress=function(){  
if(!this.ref.is\_move){  
this.xpos=eval(this.ref.target\_mc).\_x \< this.ref.target\_xpos ? (eval(this.ref.target\_mc).\_x+this.ref.scroll\_buffer) : this.ref.target\_xpos  
this.ypos=eval(this.ref.target\_mc).\_y  
this.ref.move\_sl(eval(this.ref.target\_mc),this.xpos,this.ypos,this.ref.speed)  
}  
}  
this.prev\_btn.onRollOver=function(){  
this.nextFrame()  
}  
this.prev\_btn.onRollOut=function(){  
this.prevFrame()  
}  
for(var i=1;i\<=cnt;i++){  
this.attachMovie(“button\_mc”,“button\_mc”+i,5+i)  
this[“button\_mc”+i].ref=this  
this[“button\_mc”+i].xpos=(this.target\_xpos-(i-1)\*this.scroll\_buffer)  
this[“button\_mc”+i].ypos=this.target\_ypos  
this[“button\_mc”+i].useHandCursor=false  
this[“button\_mc”+i].onPress=function(){  
this.ref.move\_sl(eval(this.ref.target\_mc),this.xpos,this.ypos,this.ref.speed)  
}  
this[“button\_mc”+i].onRollOver=function(){  
this.nextFrame()   
}  
this[“button\_mc”+i].onRollOut=function(){  
this.prevFrame()   
}

```
}

```

}  
// moverment  
armScroll.prototype.move\_sl=function(mc, nx, ny, sp){  
this.is\_move=true  
this.createEmptyMovieClip(“tmp”, 1000);  
this.tmp.nx=Math.round(nx)  
this.tmp.ny=Math.round(ny)  
this.tmp.sp=sp  
this.tmp.ref=this  
this.tmp.onEnterFrame = function() {  
var def\_x = (this.nx-eval(mc).\_x)/this.sp;  
var def\_y = (this.ny-eval(mc).\_y)/this.sp;  
eval(mc).\_x += def\_x;  
eval(mc).\_y += def\_y;

```
if ((Math.abs(eval(mc)._x-this.nx)&lt;=.6) && (Math.abs(eval(mc)._y-this.ny)&lt;=.6)) {
		eval(mc)._x = this.nx;
		eval(mc)._y = this.ny;
		this.ref.is_move=false
		this.onEnterFrame = undefined;
		this.removeMovieClip();
	}
}	

```

}  
armScroll.prototype.createRect = function(nm, x1, y1, w, h, mclr, bclr,dpt) {  
this.createEmptyMovieClip(nm, dpt);  
this[nm].lineStyle(0, bclr, 100);  
this[nm].beginFill(mclr);  
this[nm].moveTo(x1, y1);  
this[nm].lineTo(x1+w, y1);  
this[nm].lineTo(x1+w, y1+h);  
this[nm].lineTo(x1, y1+h);  
this[nm].lineTo(x1, y1);  
this[nm].endFill();  
}  
// set\_target\_mc(mc)  
armScroll.prototype.set\_target\_mc = function(mc){  
this.target\_mc=mc  
this.init()  
}  
// set\_scroll\_buffer  
armScroll.prototype.set\_scroll\_buffer = function(buffer){  
this.scroll\_buffer=buffer  
this.init()  
//this.add\_buttons(this.s\_cnt)  
}  
// set\_scroll\_cnt  
armScroll.prototype.set\_scroll\_cnt = function(cnt){  
this.s\_cnt=cnt  
this.init()

}  
//set\_speed  
armScroll.prototype.set\_speed = function(sp){  
this.speed=sp

}

#endinitclip

Thank you.

Bob
