Applying transitition to function

I have a transition that works fine when I put it on a frame with my movie clip but I am trying to make it into a function. my movie clip instances are called mc1 thru mc5. The code is

function (BounceEffect){
mx.transitions.TransitionManager.start(this[“mc” + q], {type:mx.transitions.Wipe, direction:0, duration:1, easing:mx.transitions.easing.Bounce.easeOut, param1:empty, param2:empty});

but when I write
BounceEffect();
q = 1;

in the frame with the movie clip it doesn’t work, also the value q stays undefined.

Any ideas??