# Calling functions in loaded swf

**URL:** <https://forum.kirupa.com/t/calling-functions-in-loaded-swf/308420>\
**Category:** flash\
**Created:** [April 22, 2010, 2:44pm UTC](https://forum.kirupa.com/t/calling-functions-in-loaded-swf/308420 "2010-04-22T14:44:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![snok](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@snok](https://forum.kirupa.com/u/snok)\
**Post date:** [April 22, 2010, 2:44pm UTC](https://forum.kirupa.com/t/calling-functions-in-loaded-swf/308420/1 "2010-04-22T14:44:16Z")

</div>

Hi!

I am having problems calling functions in a SWF (B.swf) which I load into my first SWF (A.swf).

Nothing seem to happen when I call the functions, values that are supposed to be returned from the function call are undefined.

Can someone tell me what I’m doing wrong?

## A.swf

import x;  
import y;

class abc{

private var ex1;  
private var ex2;

public function exampleFunction {  
System.security.allowDomain("\*");  
loadMovieNum(“[http://127.0.0.1/.../B.swf](http://127.0.0.1/.../B.swf)”, 1);

```
	trace(_level1.functionB());

```

}

}

## B.swf

import x;  
import y;

class def{

private var ex3;  
private var ex4;

public function functionB():String{  
System.security.allowDomain("\*");  
return “test”;  
}

}
