PDA

View Full Version : Refering to a MC



Neolumi
December 14th, 2006, 01:12 PM
Hi, I'm having a bit of trouble getting my head round this, I have some xml which is looping through and putting movieclips on the stage:

var currentThumb_mc = port.attachMovie("port_item", "thumbnail_mc"+i,i);

how would i refer to the previous movieclip that was output, i've tried all sorts like:
x = port.currentThumb_mc + (i - 1);

anytime I try to strict data type the variable to object or movieclip it doesnt work, every once in a i while i get a NaN (Not a Number) error when tracing.

thanks!

-infect-
December 14th, 2006, 01:53 PM
var currentThumb_mc = port.attachMovie("port_item", "thumbnail_mc"+i,i);

how would i refer to the previous movieclip that was output, i've tried all sorts like:
x = port.currentThumb_mc + (i - 1);



try this


x = port["currentThumb_mc" + (i-1)]

Neolumi
December 14th, 2006, 02:17 PM
that worked great! thanks :beer: