I have a code in my movie, which works fine, but for fun of it I wanted to rewrite it using functions .. just cannot get it to work properly:
On the MC flake0 in _root.txtRMC.ballMC
onClipEvent (load) { n = 1; pad = _root.txtRMC.ballMC; pad.flake0._visible = false; }
onClipEvent (enterFrame) { _root.moveDots (pad, flake0, flake, 20, 25); }
On the maintimeline:
function moveDots (pad, theClip, ClipClean, xstart, nrClips) {
if (n <= nrClips) { pad.theClip.duplicateMovieClip("ClipClean"+n, n); rClip = pad["ClipClean"+n]; rClip._x = xstart + (n*-10); rClip._alpha = (n*5); n += 1;
trace("rClipX= "+rClip._x); trace("rClip= "+rClip); trace("pad= "+pad); trace("theClip= "+theClip); trace("theClipClean= "+ClipClean); trace("xstart= "+xstart); trace("nrClips= "+nrClips); trace("n= "+n);
}else{
n=1
}
}
Result of the traces:
rClipX= rClip= pad= _level0.txtRMC.ballMC theClip= theClipClean= xstart= 20 nrClips= 25 n= 1
Can anybody give me a hand?
k, I changed it a little ..
onClipEvent (enterFrame) { _root.moveDots (pad, "flake0", "flake", 20, 25); }
Now gives me: rClip= rClipX= pad= _level0.txtRMC.ballMC theClip= flake0 theClipClean= flake xstart= 20 nrClips= 25 n= 1
Still lost on the rClip values.