# Function on / function off

**URL:** <https://forum.kirupa.com/t/function-on-function-off/6501>\
**Category:** Uncategorized\
**Created:** [October 9, 2002, 5:12am UTC](https://forum.kirupa.com/t/function-on-function-off/6501 "2002-10-09T05:12:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![waffe](https://avatars.discourse-cdn.com/v4/letter/w/c37758/32.png) [@waffe](https://forum.kirupa.com/u/waffe)\
**Post date:** [October 9, 2002, 5:12am UTC](https://forum.kirupa.com/t/function-on-function-off/6501/1 "2002-10-09T05:12:55Z")

</div>

I have the function  
\_root.screen.onSoundComplete = function() {  
combobox.setselectedindex(combobox.getselectedindex()+1);  
};

on fram 2 of the main time line.

When I am on frame 1 for the first time in published mode, the function does not exist, but when I go to frame 2 and back to frame 1 the function now exist in frame 1.

any Suggestions would be great.

---

<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:** [October 9, 2002, 5:20am UTC](https://forum.kirupa.com/t/function-on-function-off/6501/2 "2002-10-09T05:20:46Z")

</div>

Ask yourself this, how can the function exist is Flash hasn’t read it yet?

Help any?

---

<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:** [October 9, 2002, 5:45am UTC](https://forum.kirupa.com/t/function-on-function-off/6501/3 "2002-10-09T05:45:08Z")

</div>

The action only exists in frame 2.  
The 1st time I enter frame 1, all is well.  
When I go to frame 2 and back to 1,  
the action exists on frame 1.

Is there a way to turn the function off when I go back to frame 1 ?

---

<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:** [October 9, 2002, 5:47am UTC](https://forum.kirupa.com/t/function-on-function-off/6501/4 "2002-10-09T05:47:54Z")

</div>

I don’t think it is the function that is doing that.

You go to frame one and the function does what it does (moves your item up 1), then change will stick frame one since it is a direct edit to the component. I think that is how it works.

If you want it to go back, try added another function of -1 on the first frame ?? Just theory, but worth a try.

---

<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:** [October 9, 2002, 6:44am UTC](https://forum.kirupa.com/t/function-on-function-off/6501/5 "2002-10-09T06:44:55Z")

</div>

Ok, got it down.

Your negative 1 idea is almost it. Load a movie from your library into a new blank movie clip on frame 1 of the main timeline. The move you load has to have the same function as in frame two.

weird - but it works.

---

<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:** [October 9, 2002, 6:46am UTC](https://forum.kirupa.com/t/function-on-function-off/6501/6 "2002-10-09T06:46:05Z")

</div>

Hmmm, interesting. Glad you could figure it out though 🙂
