# Should be pretty easy AS to fix: Function controlled by other mc

**URL:** <https://forum.kirupa.com/t/should-be-pretty-easy-as-to-fix-function-controlled-by-other-mc/176790>\
**Category:** Uncategorized\
**Created:** [January 26, 2006, 10:17pm UTC](https://forum.kirupa.com/t/should-be-pretty-easy-as-to-fix-function-controlled-by-other-mc/176790 "2006-01-26T22:17:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lariat1997](https://avatars.discourse-cdn.com/v4/letter/l/df705f/32.png) [@lariat1997](https://forum.kirupa.com/u/lariat1997)\
**Post date:** [January 26, 2006, 10:17pm UTC](https://forum.kirupa.com/t/should-be-pretty-easy-as-to-fix-function-controlled-by-other-mc/176790/1 "2006-01-26T22:17:30Z")

</div>

Hey all,

I am having an issue with an mc controlling another mc via a function on my main timeline.

Here is the function on my main timeline:  
[COLOR=Blue]homeComp = function(mc, mcX, mcY) {  
this.mc.\_x = mcX;  
this.mc.\_y = mcY;  
};

homeComp(this.techA\_mc, 873, 517);

[COLOR=Black]I now call the function from inside of another mc via on(press) event as follows:[/COLOR] \_parent.homeComp();

[/COLOR][COLOR=Black] **So what I am trying to do is:**  
[/COLOR][COLOR=Black]I’ve created an mc that acts as a button. It calls the AS[/COLOR][COLOR=Blue] \_parent.homeComp(); [COLOR=Black]function. You can see what the homeComp() function does from above.

**What the AS is supposed to do:**  
When the button mc is pressed, it will tell techA\_mc to go to the position of 873, 517.

…but nothing happens.

Any help would be greatly appreciated!  
[/COLOR][/COLOR][COLOR=Blue]

[/COLOR]
