# Functions and load movie

**URL:** https://forum.kirupa.com/t/functions-and-load-movie/167183
**Category:** Uncategorized
**Created:** [October 26, 2005, 3:39am UTC](https://forum.kirupa.com/t/functions-and-load-movie/167183 "2005-10-26T03:39:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![flash\_noob1](https://avatars.discourse-cdn.com/v4/letter/f/8e7dd6/32.png) [@flash\_noob1](https://forum.kirupa.com/u/flash_noob1)
#### Post date: [October 26, 2005, 3:39am UTC](https://forum.kirupa.com/t/functions-and-load-movie/167183/1 "2005-10-26T03:39:36Z")

</div>

On the first frame of the maintimeline I have the following code…

First I declare a variable…

var course\_name = “language\_arts”;

Then I define a function with 1 parameter…

function teaching\_question\_button(problem\_number) {  
loadMovie(course\_name+"/problem"+problem\_number+".swf", “\_root.problem\_movie\_clip\_holder”);  
}

On a button on the main time line I call the function and pass a parameter…

on (press) {  
\_root.teaching\_question\_button(001);  
}

This wont work any ideas?
