# Link Transition Needs Help

**URL:** <https://forum.kirupa.com/t/link-transition-needs-help/63277>\
**Category:** flash\
**Created:** [September 4, 2004, 7:24pm UTC](https://forum.kirupa.com/t/link-transition-needs-help/63277 "2004-09-04T19:24:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![headznet](https://avatars.discourse-cdn.com/v4/letter/h/34f0e0/32.png) [@headznet](https://forum.kirupa.com/u/headznet)\
**Post date:** [September 4, 2004, 7:24pm UTC](https://forum.kirupa.com/t/link-transition-needs-help/63277/1 "2004-09-04T19:24:57Z")

</div>

I am having a problem with my AS freezing up flash.  
Here is my code:

// start position  
main\_mc.\_width = 220;  
main\_mc.\_height = 120;  
link1\_btn.\_visible = 0;  
link1\_mc.\_alpha = 100;  
link2page\_mc.\_alpha = 0;  
link2page\_mc.\_visible = 0;  
link3page\_mc.\_alpha = 0;  
link3page\_mc.\_visible = 0;

// declaring witch link, btn, and page is active  
activeLink = link1\_mc;  
activeBtn = link1\_btn;  
activePage = link1page\_mc;

// link and page transitions  
MovieClip.prototype.linkSwitch = function(speed, mainW, mainH, mainA, link\_mc, button\_btn, page\_mc) {  
transition = true;  
activeLink.\_alpha += (60-activeLink.\_alpha)/speed;  
activePage.\_alpha += (0-activePage.\_alpha)/speed;  
activBtn.\_visible = 1;  
startTrans = true;  
while (transition == true) {  
if (startTrans == true) {  
if (activePage.\_alpha == 0) {  
activePage.\_visible = 0;  
main\_mc.\_width += (mainW-main\_mc.\_width)/speed;  
main\_mc.\_height += (mainH-main\_mc.\_height)/speed;  
main\_mc.\_alpha += (mainA-main\_mc.\_alpha)/speed;  
startTrans = false;  
midTrans = true;  
}  
} else if (midTrans == true) {  
if ((main\_mc.\_width == mainW) && (main\_mc.\_height == mainH)) {  
midTrans = false;  
}  
} else {  
button\_btn.\_visible = 0;  
page\_mc.\_visible = 1;  
page\_mc.\_alpha += (100-page\_mc.\_alpha)/speed;  
link\_mc.\_alpha += (100-link\_mc.\_alpha)/speed;  
activeLink = link\_mc;  
activeBtn = button\_btn;  
activePage = page\_mc;  
transition = false;  
}  
}  
};

//call function  
link2\_btn.onRelease = function() {  
onEnterFrame = function () {  
linkSwitch(5, 120, 220, 100, link2\_mc, link2\_btn, link2page\_mc);  
};  
};

I have also attached the file.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 5, 2004, 2:40am UTC](https://forum.kirupa.com/t/link-transition-needs-help/63277/2 "2004-09-05T02:40:37Z")

</div>

im pretty sure you can’t do this:  
//call function  
link2\_btn.onRelease = function() {  
**onEnterFrame = function () {**  
linkSwitch(5, 120, 220, 100, link2\_mc, link2\_btn, link2page\_mc);  
};  
};

it needs to say  
**this.** onEnterFrame = function () {

that seems to keep it from crashing but i doesnt seem to make the menu work.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 6, 2004, 4:39am UTC](https://forum.kirupa.com/t/link-transition-needs-help/63277/3 "2004-09-06T04:39:10Z")

</div>

Thanks exygen. Does anyone know why its not working?
