# Changing the function of a button depending on previous button press

**URL:** <https://forum.kirupa.com/t/changing-the-function-of-a-button-depending-on-previous-button-press/219229>\
**Category:** Uncategorized\
**Created:** [March 14, 2007, 10:54pm UTC](https://forum.kirupa.com/t/changing-the-function-of-a-button-depending-on-previous-button-press/219229 "2007-03-14T22:54:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hazzus](https://avatars.discourse-cdn.com/v4/letter/h/6a8cbe/32.png) [@hazzus](https://forum.kirupa.com/u/hazzus)\
**Post date:** [March 14, 2007, 10:54pm UTC](https://forum.kirupa.com/t/changing-the-function-of-a-button-depending-on-previous-button-press/219229/1 "2007-03-14T22:54:51Z")

</div>

Hi all,

this problem has been stressing me out all day! (its probably extremely simple, but i can’t get my head round it)

I was wondering if anyone can help me, I’m loading in 5 jpegs from an external file using “loadMovie” and i have 5 corresponding buttons (1-5) to load them with.

I want to change the jpeg the button loads in depending whether a separate navigation button has been pressed -

i.e.

navigation buttons:

-motorbike pics  
-car pics  
-lorry pics

If a user clicked on “car pics” then the loading buttons 1 to 5 would load “car1.jpg”, “car2.jpg” and so on…

similarly if the user clicked on “lorry pics”, the same loading buttons 1 to 5 would load “lorry1.jpg” and “lorry2.jpg”

any help and code snippets would be greatly appreciated!

Thankyou!
