# Function from a button

**URL:** <https://forum.kirupa.com/t/function-from-a-button/11476>\
**Category:** Uncategorized\
**Created:** [January 17, 2003, 6:14pm UTC](https://forum.kirupa.com/t/function-from-a-button/11476 "2003-01-17T18:14:12Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![DDD](https://avatars.discourse-cdn.com/v4/letter/d/9fc348/32.png) [@DDD](https://forum.kirupa.com/u/DDD)\
**Post date:** [January 17, 2003, 6:14pm UTC](https://forum.kirupa.com/t/function-from-a-button/11476/1 "2003-01-17T18:14:12Z")

</div>

I have a function that is in the “action” layer of my .fla. Now I have a button in another layer. How do I call that function from a on (release) or something. This is what my function is called function next()

I know this is a bonehead question…Sorry Peeps. I am going to be lurking this forum cause I am working on a big flash project. So please dont tar and feather me.

---

<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:** [January 17, 2003, 6:28pm UTC](https://forum.kirupa.com/t/function-from-a-button/11476/2 "2003-01-17T18:28:37Z")

</div>

::b.u.m.p::

---

<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:** [January 17, 2003, 7:33pm UTC](https://forum.kirupa.com/t/function-from-a-button/11476/3 "2003-01-17T19:33:05Z")

</div>

bump again…no one loves me ☹ ☹

---

<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:** [January 17, 2003, 8:43pm UTC](https://forum.kirupa.com/t/function-from-a-button/11476/4 "2003-01-17T20:43:19Z")

</div>

Okay I kinda got it working when I use one of the default component button and change the clik handler to “next” which is the name of my function it works. But in my homemade button I have this code

```php

on (release) {

    _root.next();
}

```

Shouldn;t that fire my function…Pleez help!!!

---

<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:** [January 17, 2003, 10:07pm UTC](https://forum.kirupa.com/t/function-from-a-button/11476/5 "2003-01-17T22:07:23Z")

</div>

Okay I finally got help on this matter:

For what it is worth to call a function from a embedded movie using a button you have to:

```php

on(release) {

     _level0.mcinstancename.functionName();
}

```

What I was forgetting was the movie clip instance name. This just in case someone else had or has the problem I had doing it.

---

<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:** [January 17, 2003, 10:54pm UTC](https://forum.kirupa.com/t/function-from-a-button/11476/6 "2003-01-17T22:54:00Z")

</div>

> \*Originally posted by 3d-iva \*  
> \*\*This just in case someone else had or has the problem I had doing it. \*\*

thanks 3d-iva 🙂

---

<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:** [January 18, 2003, 10:30pm UTC](https://forum.kirupa.com/t/function-from-a-button/11476/7 "2003-01-18T22:30:22Z")

</div>

thanks! 🙂

[SIZE=1]sen: I´m stunnedt to find that you didn´t know about that :crazy: , I really am[/SIZE] :hangover:

---

<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:** [January 18, 2003, 10:41pm UTC](https://forum.kirupa.com/t/function-from-a-button/11476/8 "2003-01-18T22:41:22Z")

</div>

I didnt say I didnt know, I was just thanking him for posting the answer after finding it. That helps others who might have found this post in a search 🙂

---

<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:** [January 18, 2003, 10:55pm UTC](https://forum.kirupa.com/t/function-from-a-button/11476/9 "2003-01-18T22:55:05Z")

</div>

I bet that works on everything just like other object langs.

---

<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:** [January 18, 2003, 11:14pm UTC](https://forum.kirupa.com/t/function-from-a-button/11476/10 "2003-01-18T23:14:04Z")

</div>

Im like a novice when it come to AS…I got the design portion pretty good but AS eludes me (I try not to ask the same question 2x). Yeah if I ever have a problem and find out the answer outside of this board I always put the answer up. Just as a F.Y.I
