# Can you pass variable from within function?

**URL:** <https://forum.kirupa.com/t/can-you-pass-variable-from-within-function/258861>\
**Category:** flash\
**Created:** [April 29, 2008, 1:16am UTC](https://forum.kirupa.com/t/can-you-pass-variable-from-within-function/258861 "2008-04-29T01:16:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BeechyBoy](https://avatars.discourse-cdn.com/v4/letter/b/8e8cbc/32.png) [@BeechyBoy](https://forum.kirupa.com/u/BeechyBoy)\
**Post date:** [April 29, 2008, 1:16am UTC](https://forum.kirupa.com/t/can-you-pass-variable-from-within-function/258861/1 "2008-04-29T01:16:34Z")

</div>

2 basic questions:

1. Can you pass a ‘var’ from within one function to another?
2. How do you do it???

Want to pass ‘ObjectID’ which is made up from a result value into the ‘my3d’ function. Doesn’t register it at the moment?

```auto
public function cbPages(result:Object):void {
			var objectID:String = result.title;
			trace(objectID);
		}
		
		override protected function my3d():void {
			cow=new Collada(objectID);
			default_scene.addChild(cow);
		}

```

Many thanks for your help in advance.
