# \[FMX\] function call from outside function

**URL:** https://forum.kirupa.com/t/fmx-function-call-from-outside-function/151972
**Category:** flash
**Created:** [June 20, 2005, 7:10am UTC](https://forum.kirupa.com/t/fmx-function-call-from-outside-function/151972 "2005-06-20T07:10:16Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![watcher](https://avatars.discourse-cdn.com/v4/letter/w/77aa72/32.png) [@watcher](https://forum.kirupa.com/u/watcher)
#### Post date: [June 20, 2005, 7:10am UTC](https://forum.kirupa.com/t/fmx-function-call-from-outside-function/151972/1 "2005-06-20T07:10:16Z")

</div>

issue: i have an mc called mcTextEffects attached to the stage:  
attachMovie(“mcTextEffects”, “mcTextEffects”, getNextHighestDepth());

inside this mc, there is function which accepts following parameters:  
function displayText(sText:String, nEff:Number){  
…  
}

this function animates string-input “sText” in some way according to “nEff”…

(1) mcTextEffects is attached in \_root timeline  
(2) function displayText is contained within mcTextEffects.

I want to call this funcion from \_root timeline after mcTextEffects has been attached. I tried this way:  
mcTextEffects.displayText(“hallooo”, 2);

doesnt work.

I found out that this way it works:  
var nIntervall:Number=setInterval(animate, 0); // delay can be zero!!  
function animate():Void{  
clearInterval(nIntervall);  
mcTextEffects.displayText(“hallooo”, 2);  
};

I would like to understand what is going on, and why i cant access the function through simply calling \_root.mc.function() as mentioned above.

Any help apprecciated 🙂
