# Flash MX - Common function?

**URL:** <https://forum.kirupa.com/t/flash-mx-common-function/7722>\
**Category:** Uncategorized\
**Created:** [November 6, 2002, 12:08pm UTC](https://forum.kirupa.com/t/flash-mx-common-function/7722 "2002-11-06T12:08:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rasarasan](https://avatars.discourse-cdn.com/v4/letter/r/ecc23a/32.png) [@rasarasan](https://forum.kirupa.com/u/rasarasan)\
**Post date:** [November 6, 2002, 12:08pm UTC](https://forum.kirupa.com/t/flash-mx-common-function/7722/1 "2002-11-06T12:08:36Z")

</div>

I have a movie where i have small clips which has to perform the same function on a mouseevent. Instead of attaching the same script in all the movieclips, i want to put them in a common function and just call that function everytime.  
Is this possible in actionscript?  
if so how?  
Any help on this is appreciated.  
Thanks

---

<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:** [November 6, 2002, 12:24pm UTC](https://forum.kirupa.com/t/flash-mx-common-function/7722/2 "2002-11-06T12:24:03Z")

</div>

post here the script you plan to make a function, i can see if can help then…

---

<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:** [November 6, 2002, 12:25pm UTC](https://forum.kirupa.com/t/flash-mx-common-function/7722/3 "2002-11-06T12:25:16Z")

</div>

Hey rasarasan,

Well, yep, this can be done! try something like:

```php
function Link(){
	//ur commands!
}
button.onRelease = Link;

```

yours,  
h88

---

<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:** [November 6, 2002, 12:25pm UTC](https://forum.kirupa.com/t/flash-mx-common-function/7722/4 "2002-11-06T12:25:51Z")

</div>

> \*Originally posted by richie \*  
> \*\*post here the script you plan to make a function, i can see if can help then… \*\*

hehe, we posted at the same time =)!!

---

<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:** [November 6, 2002, 12:38pm UTC](https://forum.kirupa.com/t/flash-mx-common-function/7722/5 "2002-11-06T12:38:26Z")

</div>

hehehe, i just started here…  
well, i think in this case you have to use functions with arguments:

function links(link){  
trace("This button will go to the link " + link);  
}

button.onRelease = link(file1.swf);

i’m a newby, so i don’t know if it is 100% correct.

---

<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:** [November 6, 2002, 12:51pm UTC](https://forum.kirupa.com/t/flash-mx-common-function/7722/6 "2002-11-06T12:51:55Z")

</div>

Why are you going that further when u simply can use getURL!

i think she wanted that thing:

```php
stop();
function links(){
getURL("http://www.kirupaforum.com/");
}

button.onRelease = links

```

The Title was “Common function???”, remember 🙂

yours,  
h88
