# Calling function problem

**URL:** <https://forum.kirupa.com/t/calling-function-problem/30439>\
**Category:** Uncategorized\
**Created:** [September 8, 2003, 11:26pm UTC](https://forum.kirupa.com/t/calling-function-problem/30439 "2003-09-08T23:26:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![moshlp](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@moshlp](https://forum.kirupa.com/u/moshlp)\
**Post date:** [September 8, 2003, 11:26pm UTC](https://forum.kirupa.com/t/calling-function-problem/30439/1 "2003-09-08T23:26:05Z")

</div>

hi, i have 8 buttons and when I press on one of them it loads a movie, what I want to do is when I press another button it loads another movie, but it must depend if there´s been another movie loaded before.

example: i have 8 buttons: instance names; btn1, btn2…btn8  
and when i press btn1 it loads btn1.swf, but if I press btn2 it should load btn1-back.swf and btn2.swf…and if I press btn3, it should load btn2-back.swf and btn3.swf…but it depends on what button was pressed before…the problem is how to do that with the 8 buttons?, i think i should use a function, but I dunno how to connect the buttons …any idea???
