# Problem using TransitionManager inside a function

**URL:** <https://forum.kirupa.com/t/problem-using-transitionmanager-inside-a-function/205739>\
**Category:** flash\
**Created:** [November 1, 2006, 2:50pm UTC](https://forum.kirupa.com/t/problem-using-transitionmanager-inside-a-function/205739 "2006-11-01T14:50:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gordonglobal](https://avatars.discourse-cdn.com/v4/letter/g/e9bcb4/32.png) [@gordonglobal](https://forum.kirupa.com/u/gordonglobal)\
**Post date:** [November 1, 2006, 2:50pm UTC](https://forum.kirupa.com/t/problem-using-transitionmanager-inside-a-function/205739/1 "2006-11-01T14:50:12Z")

</div>

Hello.

I want to create a function that will allow me to pass an mc instance into the TransitionManager class, and I want to do it with the setTimeout function so I can get the timing right

i.e.

```auto
 
function fadeIn(theTarget) {
trace(theTarget);
TransitionManager.start(theTarget, {type:Fade, direction:Transition.IN, duration:1, easing:None.easeNone});
}

```

doesn’t work

to be called with the name of the instance I want to fade, from inside the setTimeout function:

```auto
setTimeout(fadeIn,4000,'_root.ins_searchMovie.ins_searchText.searchScript12a');

```

The trace shows that the setTimeout is calling my fadeIn function, and passing the right variables… however nothing happnes with the TransitionManager UNLESS I declare the var for the mc instance INSIDE of the fadeIn function, even though the correct variables are already being parsed, which is useless… any clues?

```auto
 
function fadeIn(theTarget) {
trace(theTarget);
var theTarget = _root.ins_searchMovie.ins_searchText.searchScript12a;
TransitionManager.start(theTarget, {type:Fade, direction:Transition.IN, duration:1, easing:None.easeNone});
}

```

This works, but is useless…

thanks.
