# Function writing

**URL:** <https://forum.kirupa.com/t/function-writing/180878>\
**Category:** Uncategorized\
**Created:** [March 4, 2006, 4:54am UTC](https://forum.kirupa.com/t/function-writing/180878 "2006-03-04T04:54:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spyderfx](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@spyderfx](https://forum.kirupa.com/u/spyderfx)\
**Post date:** [March 4, 2006, 4:54am UTC](https://forum.kirupa.com/t/function-writing/180878/1 "2006-03-04T04:54:59Z")

</div>

i’m trying to get an external MC to load at a certain spot on my main swf when they press the “Home” button. i use to have it so it would go to a transition mc and it would trigger it but i want to do it differently now. i want to do it so that when they press the “Home” button it triggers a function. i’m bad at writing functions as of right now. can anyone tell me what is wrong with what i’ve got

function LoadEx(){  
this.createEmptyMovieClip(“myMc”, this.getNextHighestDepth());  
myMc.\_x = 0;  
myMc.\_y = 0;  
myMc.loadMovie(\_root.section);  
}

//Buttons  
h1.onRelease = function() {  
if (\_root.section != “HomePage.swf”) {  
\_root.section = “HomePage.swf”;  
loadEx();  
}}

any help appreciated
