# \[FMX\] function call from outside timeline

**URL:** <https://forum.kirupa.com/t/fmx-function-call-from-outside-timeline/151969>\
**Category:** flash\
**Created:** [June 20, 2005, 6:50am UTC](https://forum.kirupa.com/t/fmx-function-call-from-outside-timeline/151969 "2005-06-20T06:50:17Z")\
**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, 6:50am UTC](https://forum.kirupa.com/t/fmx-function-call-from-outside-timeline/151969/1 "2005-06-20T06:50:17Z")

</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 🙂
