[size=5]New Problem:[/size]
Read Post #5
Hey guys, I’m working on a dynamic scrolling logo display, basically when the user rolls over one of the constantly scrolling logos, text appears beneath in a text field.
I have it set up like so:
Root Timeline:
container_mc
…logoContainer_mc (which gets duplicated and placed next to the one before it)
…logo_mc (where the logos are loaded into)
…logoTitle_txt (the textfield that displays the company name)
…logo_btn (the invisible button that you click to visit the homepage of that company)
So within container_mc, logoContainer_mc is duplicated and populated with images/text from an XML file.
**
My Code:
** ActionScript Code:
[FONT=Courier New][LEFT]title_a = [COLOR=#000000][[/COLOR][COLOR=#000000]][/COLOR];
xmlData = [COLOR=#000000]new[/COLOR] [COLOR=#0000FF]XML[/COLOR]COLOR=#000000[/COLOR];
xmlData.[COLOR=#0000FF]ignoreWhite[/COLOR] = [COLOR=#000000]true[/COLOR];
xmlData.[COLOR=#0000FF]onLoad[/COLOR] = loadXML;
xmlData.[COLOR=#0000FF]load[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#000000]var[/COLOR] imageLoader:[COLOR=#0000FF]MovieClipLoader[/COLOR] = [COLOR=#000000]new[/COLOR] [COLOR=#0000FF]MovieClipLoader[/COLOR]COLOR=#000000[/COLOR];
imageLoader.[COLOR=#0000FF]addListener[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#000000]function[/COLOR] loadXMLCOLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]if[/COLOR] COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]xmlNode[/COLOR] = [COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]firstChild[/COLOR];
total = [COLOR=#0000FF]xmlNode[/COLOR].[COLOR=#0000FF]childNodes[/COLOR].[COLOR=#0000FF]length[/COLOR];
[COLOR=#0000FF]for[/COLOR] [COLOR=#000000]([/COLOR]i=[COLOR=#000080]0[/COLOR]; i<total; i++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
title_a[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR] = [COLOR=#0000FF]xmlNode[/COLOR].[COLOR=#0000FF]childNodes[/COLOR][COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR].[COLOR=#0000FF]childNodes[/COLOR][COLOR=#000000][[/COLOR][COLOR=#000080]0[/COLOR][COLOR=#000000]][/COLOR].[COLOR=#0000FF]firstChild[/COLOR].[COLOR=#0000FF]nodeValue[/COLOR];
[COLOR=#0000FF]_root[/COLOR].[COLOR=#000080]container_mc[/COLOR].[COLOR=#000080]logoContainer_mc[/COLOR].[COLOR=#0000FF]duplicateMovieClip[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000][[/COLOR][COLOR=#FF0000]“logoContainer”[/COLOR]+i[COLOR=#000000]][/COLOR], i, [COLOR=#000000]{[/COLOR][COLOR=#0000FF]_x[/COLOR]:COLOR=#000000[/COLOR][COLOR=#000080]162[/COLOR], [COLOR=#0000FF]_y[/COLOR]:[COLOR=#000080]0[/COLOR][COLOR=#000000]}[/COLOR][COLOR=#000000])[/COLOR];
imageLoader.[COLOR=#0000FF]loadClip[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“logos/”[/COLOR]+i+[COLOR=#FF0000]".jpg"[/COLOR], [COLOR=#0000FF]_root[/COLOR].[COLOR=#000080]container_mc[/COLOR][COLOR=#000000][[/COLOR][COLOR=#FF0000]“logoContainer”[/COLOR]+i[COLOR=#000000]][/COLOR].[COLOR=#000080]logo_mc[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#0000FF]_root[/COLOR].[COLOR=#000080]container_mc[/COLOR][COLOR=#000000][[/COLOR][COLOR=#FF0000]“logoContainer”[/COLOR]+i[COLOR=#000000]][/COLOR].[COLOR=#000080]logo_btn[/COLOR].[COLOR=#0000FF]onRollOver[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]trace[/COLOR]COLOR=#000000[/COLOR]; [COLOR=#808080]//Here’s the problem, this is returning undefined, when it shouldn’t.[/COLOR]
[COLOR=#0000FF]_root[/COLOR].[COLOR=#000080]container_mc[/COLOR][COLOR=#000000][[/COLOR][COLOR=#FF0000]“logoContainer”[/COLOR]+i[COLOR=#000000]][/COLOR].[COLOR=#000080]logoTitle_txt[/COLOR].[COLOR=#0000FF]text[/COLOR] = title_a[COLOR=#000000][[/COLOR]i-[COLOR=#000080]1[/COLOR][COLOR=#000000]][/COLOR]; [COLOR=#808080]//This should work but doesn’t.*[/COLOR]
[COLOR=#000000]}[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR] [COLOR=#0000FF]else[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“XML ERROR”[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR]
[/LEFT]
[/FONT]
*Note: the comment “Here’s the problem”
It’s pretty straightforward, but there is some path error I can’t figure out, i need to be able to assign the textfield that corresponds to the button the user is rolling over the information from the title_a[] array, but its returning undefined.
Help!!