# How to target a function/variable at parent/root?

**URL:** <https://forum.kirupa.com/t/how-to-target-a-function-variable-at-parent-root/267906>\
**Category:** Uncategorized\
**Created:** [August 7, 2008, 3:43am UTC](https://forum.kirupa.com/t/how-to-target-a-function-variable-at-parent-root/267906 "2008-08-07T03:43:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![koneko](https://avatars.discourse-cdn.com/v4/letter/k/f6c823/32.png) [@koneko](https://forum.kirupa.com/u/koneko)\
**Post date:** [August 7, 2008, 3:43am UTC](https://forum.kirupa.com/t/how-to-target-a-function-variable-at-parent-root/267906/1 "2008-08-07T03:43:35Z")

</div>

I have a new class at .as file and linkage it to my library. It

has an event click on it.  
In my time line I create a new object of that class.  
The problem is, when I click the MovieClip I want to call a

function that placed in my timeline/root or change the variable

that I declare at my timeline/root.  
How I suppose to do that?

=== with AS2 ===

- At root  
var a:Number=1;  
function func()  
{  
trace(“whatever”);  
}
- I place a movieclip at root and place the script inside it  
onRelease=function()  
{  
\_parent.a=2;  
\_parent.func();  
}  
================

Anyone can help me?  
Thx in advance.
