# Controlling button actions depending on what is loaded?

**URL:** <https://forum.kirupa.com/t/controlling-button-actions-depending-on-what-is-loaded/9344>\
**Category:** flash\
**Created:** [December 10, 2002, 2:35am UTC](https://forum.kirupa.com/t/controlling-button-actions-depending-on-what-is-loaded/9344 "2002-12-10T02:35:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bodom78](https://avatars.discourse-cdn.com/v4/letter/b/aca169/32.png) [@Bodom78](https://forum.kirupa.com/u/Bodom78)\
**Post date:** [December 10, 2002, 2:35am UTC](https://forum.kirupa.com/t/controlling-button-actions-depending-on-what-is-loaded/9344/1 "2002-12-10T02:35:39Z")

</div>

Here is my situation. Level 1 is a play and stop button which loads an animation onto Level 2, however once the movie is loaded onto Level 2, you can still press the play button which causes the animation to disappear for a split second and then starover again.

Is it possibe to tell a button that if animation.swf is loaded onto level 2, not to do anything. If animation.swf is not loaded then load it?

Cheers.

(If im not making any sense, I can whip up a .fla)

---

<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:** [December 10, 2002, 6:16am UTC](https://forum.kirupa.com/t/controlling-button-actions-depending-on-what-is-loaded/9344/2 "2002-12-10T06:16:57Z")

</div>

if you could… please provide an FLA. shouldn’t be too hard to do what you’re saying… just need some reference to work from.

---

<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:** [December 10, 2002, 8:15am UTC](https://forum.kirupa.com/t/controlling-button-actions-depending-on-what-is-loaded/9344/3 "2002-12-10T08:15:53Z")

</div>

He, I could use this to, my site has 1 movie witch loads all other parts dynamic.

---

<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:** [December 10, 2002, 12:07pm UTC](https://forum.kirupa.com/t/controlling-button-actions-depending-on-what-is-loaded/9344/4 "2002-12-10T12:07:16Z")

</div>

One the animation is loaded, it plays. But when play is pressed, the animation starts again, this is what I would like to stop by way of telling the button to do nothing if animation.swf is already loaded onto level 1.

Thanks for the reply David 🙂

---

<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:** [December 10, 2002, 2:12pm UTC](https://forum.kirupa.com/t/controlling-button-actions-depending-on-what-is-loaded/9344/5 "2002-12-10T14:12:03Z")

</div>

Just put a variable on the first frame of your loaded movie. Then on your button use an if statment to determine if the movie is loaded by looking at that variable.

---

<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:** [December 10, 2002, 3:17pm UTC](https://forum.kirupa.com/t/controlling-button-actions-depending-on-what-is-loaded/9344/6 "2002-12-10T15:17:12Z")

</div>

hope this helps have a look here i think this is what you need

[http://www.flashkit.com/tutorials/Actionscripting/Disable\_-estudiow-767/index.php](http://www.flashkit.com/tutorials/Actionscripting/Disable_-estudiow-767/index.php)

Grim

---

<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:** [December 11, 2002, 1:02am UTC](https://forum.kirupa.com/t/controlling-button-actions-depending-on-what-is-loaded/9344/7 "2002-12-11T01:02:08Z")

</div>

Hey, thanks grimdeath, I never thought of doing that. I got to try it out and see if it works for what Im trying to do.

Also thanks Sorcerer, I know what you mean but I would love an example if possible.

Thanks for the help:beam:

---

<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:** [December 11, 2002, 12:41pm UTC](https://forum.kirupa.com/t/controlling-button-actions-depending-on-what-is-loaded/9344/8 "2002-12-11T12:41:12Z")

</div>

nice to know it helped you out buddy keep flashin 😉
