# Linking to an Iframe cs3

**URL:** https://forum.kirupa.com/t/linking-to-an-iframe-cs3/263340
**Category:** Uncategorized
**Created:** [June 14, 2008, 6:01pm UTC](https://forum.kirupa.com/t/linking-to-an-iframe-cs3/263340 "2008-06-14T18:01:17Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Altra\_sonic](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Altra\_sonic](https://forum.kirupa.com/u/Altra_sonic)
#### Post date: [June 14, 2008, 6:01pm UTC](https://forum.kirupa.com/t/linking-to-an-iframe-cs3/263340/1 "2008-06-14T18:01:17Z")

</div>

Hi all:

Just hoping that someone has a quick fix!

I need to have a canned flash menu items link to pages that show up in the same page into an Iframe.

Here is the site: [http://www.westcoastsupertrucks.com/index.html](http://www.westcoastsupertrucks.com/index.html)

Here is the code so far:

function buttonRelease(id)  
{  
trace (menuLink[id]);  
getURL(menuLink[id], menuTarget[id]);  
return (true);  
} // End of the function  
Object.prototype.rTrim = function ()  
{  
for (i = this.length - 1; this.charCodeAt(i) \< 32; i–)  
{  
this = this.substring(0, i);  
} // end of for  
return (this);  
};  
ASSetPropFlags(String.prototype, [“rTrim”], 1);  
sep = 13;  
temp = “Home\rAbout Us\rProducts\rServices\rUpgrades\rGallery\rPackages\rAssociates\rContact Us\r”;  
temp = temp.rTrim();  
menuText = temp.split(chr(sep));  
menuLink = “index.html\rabout.html\rproducts.html\rservices.html\rupgrades.html\rgallery.html\rpackages.html\rassociates.html\rcontact.html”.split(chr(sep));  
menuTarget = “index.html,(I1)”.split(chr(sep));  
buttonVSpacing = isNaN(parseInt(“6”)) ? (1) : (parseInt(“6”));  
leftBorder = isNaN(parseInt(“3”)) ? (3) : (parseInt(“3”));  
topBorder = isNaN(parseInt(“3”)) ? (3) : (parseInt(“3”));  
rightBorder = isNaN(parseInt(“3”)) ? (3) : (parseInt(“3”));  
bottomBorder = isNaN(parseInt(“3”)) ? (3) : (parseInt(“3”));  
scaleInitial = isNaN(parseInt(“60”)) ? (60) : (parseInt(“60”));  
scaleFinal = isNaN(parseInt(“110”)) ? (110) : (parseInt(“110”));  
alphaInitial = isNaN(parseInt(“75”)) ? (50) : (parseInt(“75”));  
alphaFinal = isNaN(parseInt(“100”)) ? (100) : (parseInt(“100”));  
waveHeight = isNaN(parseInt(“50”)) ? (50) : (parseInt(“50”));  
alignment = “left”;  
maxButtonWidth = Math.ceil(button.\_width) \* scaleFinal / 100;  
maxButtonHeight = Math.ceil(button.\_height) \* scaleFinal / 100;  
totalButtons = menuText.length;  
button.\_visible = false;  
dummy.\_visible = false;  
nextY = topBorder;  
for (id = 0; id \< totalButtons; id++)  
{  
duplicateMovieClip(“button”, “button” add id, id + 200);  
duplicateMovieClip(“dummy”, “dummy” add id, id);  
this[“button” add id].button.id = id;  
this[“button” add id].button.text = menuText[id];  
this[“dummy” add id].dummy.\_width = button.\_width;  
this[“dummy” add id].dummy.\_height = button.\_height;  
if (alignment == “right”)  
{  
this[“button” add id].button.\_x = this[“dummy” add id].dummy.\_x = -Math.ceil(button.\_width);  
this[“button” add id].\_x = this[“dummy” add id].\_x = leftBorder + maxButtonWidth;  
}  
else if (alignment == “center”)  
{  
this[“button” add id].button.\_x = this[“dummy” add id].dummy.\_x = -Math.ceil(button.\_width / 2);  
this[“button” add id].\_x = this[“dummy” add id].\_x = leftBorder + maxButtonWidth / 2;  
}  
else  
{  
this[“button” add id].\_x = this[“dummy” add id].\_x = leftBorder;  
} // end else if  
this[“button” add id].\_y = this[“dummy” add id].\_y = nextY;  
this[“dummy” add id].\_xscale = scaleInitial;  
this[“dummy” add id].\_yscale = scaleInitial;  
this[“button” add id].\_xscale = scaleInitial;  
this[“button” add id].\_yscale = scaleInitial;  
this[“button” add id].\_alpha = alphaInitial;  
nextY = nextY + (Math.ceil(this[“dummy” add id].\_height) + buttonVSpacing);  
} // end of for  
buttonsY = new Array();  
for (id = 0; id \< totalButtons; id++)  
{  
buttonsY[id] = Math.ceil(this[“button” add id].\_y);  
} // end of for  
menuHeight = buttonsY[totalButtons - 1] - buttonsY[0];  
movieWidth = Math.round(leftBorder + maxButtonWidth + rightBorder);  
movieHeight = Math.round(buttonsY[totalButtons - 1] + maxButtonHeight + bottomBorder);  
hideLinkBack = new Boolean(parseInt(“0”));  
if (hideLinkBack == false)  
{  
movieHeight = movieHeight + 11;  
this.attachMovie(“linkBack”, “linkBack”, 1000, {movieWidth: movieWidth, movieHeight: movieHeight, xPosition: “center”, yPosition: “bottom”, upAlpha: 20, overAlpha: 50});  
} // end if  
if (\_root.autoWidth == “1” || \_root.autoHeight == “1”)  
{  
getURL(“javascript:flashVortexSetFlashSize(’” add \_root.divId add “’,” add \_root.autoWidth add “,” add \_root.autoHeight add “,” add (movieWidth == null ? (0) : (movieWidth)) add “,” add (movieHeight == null ? (0) : (movieHeight)) add “)”, “”);  
} // end if  
this.boundBox.\_width = 2000;  
this.boundBox.\_height = 2000;  
mouseOut = false;

It will only open a new browser rather than send the pages to the iframe (I1)

Thanks in advance for any help on this!
