# Anonymous function – return values

**URL:** https://forum.kirupa.com/t/anonymous-function-return-values/236763
**Category:** flash
**Created:** [August 23, 2007, 1:45pm UTC](https://forum.kirupa.com/t/anonymous-function-return-values/236763 "2007-08-23T13:45:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bluetie](https://avatars.discourse-cdn.com/v4/letter/b/9e8a1a/32.png) [@bluetie](https://forum.kirupa.com/u/bluetie)
#### Post date: [August 23, 2007, 1:45pm UTC](https://forum.kirupa.com/t/anonymous-function-return-values/236763/1 "2007-08-23T13:45:08Z")

</div>

Hello, I will appreciate any help with this problem; let me describe a little bit what I’m trying to do:

I have 2 SWF, one.swf and two.swf  
1 LocalConnection to send 1 variable from one.swf to two.swf

**one.swf code:**

var param:Number = new Number(5);

var sending\_lc:LocalConnection = new LocalConnection();  
sending\_lc.send("\_Connection1", “myMethod”, param);

**two.swf code:**

this.createTextField(“text1\_txt”, 1, 20, 20, 100, 20);  
texto1\_txt.border = true;

var receiving\_lc:LocalConnection = new LocalConnection();  
receiving\_lc.connect("\_Connection1");  
receiving\_lc.myMethod = function (param:Number){  
text1\_txt.text = param; //just to test values  
temp = param;  
};

// I need to do this  
Switch (“param value”) {  
….  
}

This code actually works pretty well sending the “ param ‘ from one.swf to two.swf

**Problem:**

I need to be able to use “param” value out of the function, because a I need to perform a switch with this value, since the function wich receives de “param” value is an anonymous function I don’t know how to do to get the value from outside the function because a don’t have a reference name to the function so, the normal way to return a value is not going to do the job.

I will appreciate any help, thanks
