# Linking - I can't make it work

**URL:** https://forum.kirupa.com/t/linking-i-cant-make-it-work/89870
**Category:** flash
**Created:** [May 12, 2005, 9:26am UTC](https://forum.kirupa.com/t/linking-i-cant-make-it-work/89870 "2005-05-12T09:26:48Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Macro\_design](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Macro\_design](https://forum.kirupa.com/u/Macro_design)
#### Post date: [May 12, 2005, 9:26am UTC](https://forum.kirupa.com/t/linking-i-cant-make-it-work/89870/1 "2005-05-12T09:26:48Z")

</div>

I’ve been working on our new website, and in our portfolio I want image, text and a link button. It all works except from the link.

When I press the link button it links to the last item - even though item 2 ( out of 3 ) is pressed.

It’s votes thumbnail scroller thing - but I’ve had the problem with linking several times, in other projects too.

My AS looks like:  
[AS]MovieClip.prototype.easeX = function(x) {  
this.onEnterFrame = function() {  
this.\_x = Math.ceil(x-(x-this.\_x)/1.35);  
if (Math.abs(x-this.\_x)\<=1) {  
delete this.onEnterFrame;  
this.\_x = Math.ceil(x);  
}  
};  
};  
images = new Array();  
xml\_file = “projekter.xml”;  
xmlload = new XML();  
xmlload.ignoreWhite = true;  
xmlload.onLoad = function(ok) {  
if (ok) {  
count = this.firstChild.childNodes.length;  
for (var i = 0; i\<count; i++) {  
curNode = this.firstChild.childNodes\*;  
images\* = {path:curNode.childNodes[0].firstChild.nodeValue, link:curNode.childNodes[1].firstChild.nodeValue, firmaNavn:curNode.childNodes[2].firstChild.nodeValue, imgText:curNode.childNodes[3].firstChild.nodeValue, siteLink:curNode.childNodes[4].firstChild.nodeValue};  
}  
boot();  
} else {  
trace(“Could not load “+xml\_file+”.”);  
}  
};  
xmlload.load(xml\_file);  
// ------------------------------------------------------------  
spacing = 100;  
boot = function () {  
for (var i = 0; i\<images.length; i++) {  
mc = container.attachMovie(“thumbMC”, “thumb”+i, i);  
mc.\_x = i\*(60+spacing);  
mc.path = images\*.path;  
mc.link = images\*.link;  
mc.firmaNavn = images\*.firmaNavn;  
mc.finalText = images\*.imgText;  
mc.siteLink = images\*.siteLink;  
\_parent.picture.loadMovie(images[0].link);  
\_parent.firmaNavn\_txt.text = images[0].firmaNavn;  
\_parent.imageText.text = images[0].imgText;  
\_parent.siteLink\_txt.text = images[0].siteLink;  
var linkSite = images\*.siteLink;  
}  
linkBtn.onPress = function() {  
getURL(linkSite);  
};  
setRollOver();  
};  
setRollOver = function () {  
this.onEnterFrame = function() {  
if (this.mask.hitTest(\_root.\_xmouse, \_root.\_ymouse)) {  
slideMenu();  
}  
};  
};  
slideMenu = function () {  
diff = \_root.\_xmouse-this.\_x;  
scale = diff_100/this.mask.\_width;  
target = -scale_(this.container.\_width-this.mask.\_width)/100;  
this.container.easeX(target);  
};[/AS]

If anybody could help, I would really appreciate it, because it’s the last thing I need before that section is done.

Thanks, Morten
