PDA

View Full Version : Goin CRAZY! duplicateMoveClip and textField



jcnh74
March 10th, 2005, 12:32 PM
I'm building a menu based on the abount of images in an XML file. I've already got the images to load individually sequecially but now I want a menu built by duplicate movieclip. I can duplicate a movie but I can't populate the textfield in the clip with a number. plus I don't know how I'm going to get it to load the individual image.
the set function is not working.
here's a link http://jackryanphotography.com/images.php


Here's my function

/////////////////////

function buildMenu() {
trace("Total Images: " + totalSlides);
i = 1;
while (i < totalSlides) {
duplicateMovieClip(_root.dynamicMenu.menu["menuBut"],"menuBut"+i, i);
_root.dynamicMenu.menu["menuBut"+i]._x = i*sprd;
_root.dynamicMenu.menu["menuBut"+i].createTextField(["btn"+i], i, 1, 1, 20, 20);
set (_root.dynamicMenu.menu["menuBut"+i]["btn"+i],String(i));
i++;
}
}

/////////////////////

any help would be greatly appreciated
Thank
John

mpelland
March 10th, 2005, 12:38 PM
have you tried something like:
_root.dynamicMenu.menu["menuBut"+i]["btn"+i].text = String(i);
??

jcnh74
March 10th, 2005, 01:31 PM
That was the original code I tried.

Ordinathorreur
March 10th, 2005, 01:36 PM
have you embedded your font in the original text field?

jcnh74
March 10th, 2005, 02:33 PM
Yes. I tried that. I'm using Arial too. Isn't it a system font.
by the way nice signature

mpelland
March 10th, 2005, 03:23 PM
have you tried 'createEmptyMovieClip()' instead of trying to dupe it. then adding everything in there. then add the text?

jcnh74
March 10th, 2005, 03:30 PM
I got it to work but I don't now how

function buildMenu() {
trace("Total Images: " + totalSlides);
i = 1;
while (i < totalSlides) {
duplicateMovieClip(_root.dynamicMenu.menu["menuBut"],"menuBut"+i, i);
_root.dynamicMenu.menu["menuBut"+i]._x = i*sprd;
// _root.dynamicMenu.menu["menuBut"+i].createTextField(["btn"+i], i, 1, 1, 20, 20);
_root.dynamicMenu.menu["menuBut"+i].btn.text = String(i);
// set (_root.dynamicMenu.menu["menuBut"+i].btn,String(i));
// trace(_root.dynamicMenu.menu["menuBut"+i].btn);
i++;
}
}

mpelland
March 10th, 2005, 03:50 PM
lol,... so you already had a text field in there?

jcnh74
March 10th, 2005, 05:29 PM
I know what I did. I had the text field btn set to accept html.
**** I'm thick