# Usinf function from as document from inside fla. - help

**URL:** https://forum.kirupa.com/t/usinf-function-from-as-document-from-inside-fla-help/323307
**Category:** flash
**Created:** [June 24, 2011, 4:27pm UTC](https://forum.kirupa.com/t/usinf-function-from-as-document-from-inside-fla-help/323307 "2011-06-24T16:27:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![K2WEB](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@K2WEB](https://forum.kirupa.com/u/K2WEB)
#### Post date: [June 24, 2011, 4:27pm UTC](https://forum.kirupa.com/t/usinf-function-from-as-document-from-inside-fla-help/323307/1 "2011-06-24T16:27:07Z")

</div>

Good morning members of Kirupa,

I`m having trouble running a certain function that`s in my as document from inside my fla.

What needs to happen is : when i click on my button it should run the function that`s in my as.

when i compile the swf it seems like the function is unable to be called, i need help .

here is the script:

Inside Fla.

```auto
var ncontrole:Number = 1234

function goDetalhe2(e:MouseEvent)
{
galeria.goDetalhe(ncontrole);
}
btn.addEventListener(MouseEvent.CLICK, goDetalhe2);

```

script that is inside my as document:

```auto

package src
{
import lib.utils.GlobalSettings;
	import flash.display.DisplayObject;
	import flash.display.*;
	import flash.events.Event;
	import flash.utils.setInterval;
	import flash.utils.clearInterval;
	import com.greensock.*;
	import com.greensock.easing.*;
	import lib.utils.Root;
	import lib.utils.StageObj;
	import lib.utils.Targets;
	import flash.display.MovieClip;

public class galeria extends MovieClip{

public function goDetalhe(ncontrole:Number):void{
			trace(ncontrole);
		}
}
}

```

best regards,

Thomas
