[COLOR=black][FONT=Verdana]How to customize Relevare navigation menu…[/FONT][/COLOR]
[COLOR=black][FONT=Arial]This navigation menu was originally used on [COLOR=#800080]http://www.relevare.com/site/[/COLOR] .[/FONT][/COLOR]
[COLOR=black][FONT=Arial]I got the source code from [COLOR=#800080]http://laco.wz.cz/tween/?page=examples[/COLOR] , under the relevare.com navigation link. I’ve attached the [/FONT][/COLOR][COLOR=black][FONT=Arial]fla[/FONT][/COLOR][COLOR=black][FONT=Arial] and xml with this post.[/FONT][/COLOR]
[COLOR=black][FONT=Arial]I’ve managed to customize the labels for each box in the xml file, but can’t figure out how to put content like jpgs, swfs or even text in the boxes.[/FONT][/COLOR]
[COLOR=black][FONT=Arial]I’ve spent hours googling for tutorials on this without any luck. The company Relevare has ceased trading. The laco board doesn’t offer support for this example. There are a couple threads about this menu on Kirupa, but none of them say anything about customization.[/FONT][/COLOR]
[COLOR=black][FONT=Arial]This is a nifty menu I’d like to be able to customize. Any help would be much appreciated.[/FONT][/COLOR]
[COLOR=black][FONT=Arial]ActionScript Code:
[FONT=Courier New][LEFT][COLOR=#808080]#include “lmc_tween_as1.as”</p>[/COLOR]
<p>initCOLOR=#000000[/COLOR];</p>
<p>_global.[COLOR=#000080]out[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> [COLOR=#0000ff]trace[/COLOR]COLOR=#000000[/COLOR];</p>
<p>[COLOR=#000000]}[/COLOR];</p>
<p>function initCOLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> [COLOR=#0000ff]data[/COLOR] = [COLOR=#000000][[/COLOR][COLOR=#000000]][/COLOR];</p>
<p> srcfile = [COLOR=#ff0000]“menu.xml”[/COLOR];</p>
<p> loadXMLCOLOR=#000000[/COLOR];</p>
<p>[COLOR=#000000]}[/COLOR]</p>
<p>function loadXML[COLOR=#000000]([/COLOR]file, [COLOR=#0000ff]data[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> [COLOR=#000000]var[/COLOR] source_xml = [COLOR=#000000]new[/COLOR] [COLOR=#0000ff]XML[/COLOR]COLOR=#000000[/COLOR];</p>
<p> [COLOR=#000000]var[/COLOR] th = [COLOR=#0000ff]this[/COLOR];</p>
<p> source_xml.[COLOR=#0000ff]ignoreWhite[/COLOR] = [COLOR=#000000]true[/COLOR];</p>
<p> source_xml.[COLOR=#0000ff]onLoad[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> th.[COLOR=#000080]parseXMLNode[/COLOR]COLOR=#000000[/COLOR];</p>
<p> th.[COLOR=#000080]buildMenu[/COLOR][COLOR=#000000]([/COLOR]th.[COLOR=#000080]main_mc[/COLOR], [COLOR=#0000ff]data[/COLOR][COLOR=#000000])[/COLOR];</p>
<p> [COLOR=#000000]}[/COLOR];</p>
<p> source_xml.[COLOR=#0000ff]load[/COLOR]COLOR=#000000[/COLOR];</p>
<p>[COLOR=#000000]}[/COLOR]</p>
<p>function parseXMLNode[COLOR=#000000]([/COLOR]node, data_arr[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> [COLOR=#0000ff]for[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#000000]var[/COLOR] i = [COLOR=#000080]0[/COLOR]; i<node.[COLOR=#0000ff]childNodes[/COLOR].[COLOR=#0000ff]length[/COLOR]; i++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> [COLOR=#000000]var[/COLOR] n = node.[COLOR=#0000ff]childNodes[/COLOR][COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR];</p>
<p> [COLOR=#000000]var[/COLOR] nodeObj = [COLOR=#000000]{[/COLOR][COLOR=#000000]}[/COLOR];</p>
<p> [COLOR=#0000ff]for[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#000000]var[/COLOR] j [COLOR=#0000ff]in[/COLOR] n.[COLOR=#0000ff]childNodes[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> [COLOR=#0000ff]switch[/COLOR] COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> [COLOR=#0000ff]case[/COLOR] [COLOR=#ff0000]“label”[/COLOR] :</p>
<p> [COLOR=#808080]//trace(n.childNodes[j].nodeType)</p>[/COLOR]
<p> nodeObj.[COLOR=#000080]label[/COLOR] = n.[COLOR=#0000ff]childNodes[/COLOR][COLOR=#000000][[/COLOR]j[COLOR=#000000]][/COLOR].[COLOR=#0000ff]firstChild[/COLOR].[COLOR=#0000ff]nodeValue[/COLOR];</p>
<p> [COLOR=#0000ff]break[/COLOR];</p>
<p> [COLOR=#0000ff]case[/COLOR] [COLOR=#ff0000]“data”[/COLOR] :</p>
<p> nodeObj.[COLOR=#0000ff]data[/COLOR] = n.[COLOR=#0000ff]childNodes[/COLOR][COLOR=#000000][[/COLOR]j[COLOR=#000000]][/COLOR].[COLOR=#0000ff]firstChild[/COLOR].[COLOR=#0000ff]nodeValue[/COLOR];</p>
<p> [COLOR=#0000ff]break[/COLOR];</p>
<p> [COLOR=#0000ff]case[/COLOR] [COLOR=#ff0000]“subitems”[/COLOR] :</p>
<p> nodeObj.[COLOR=#000080]subitems[/COLOR] = [COLOR=#000000][[/COLOR][COLOR=#000000]][/COLOR];</p>
<p> parseXMLNode[COLOR=#000000]([/COLOR]n.[COLOR=#0000ff]childNodes[/COLOR][COLOR=#000000][[/COLOR]j[COLOR=#000000]][/COLOR], nodeObj.[COLOR=#000080]subitems[/COLOR][COLOR=#000000])[/COLOR];</p>
<p> [COLOR=#0000ff]break[/COLOR];</p>
<p> [COLOR=#000000]}[/COLOR]</p>
<p> [COLOR=#000000]}[/COLOR]</p>
<p> data_arr.[COLOR=#0000ff]push[/COLOR]COLOR=#000000[/COLOR];</p>
<p> [COLOR=#000000]}[/COLOR]</p>
<p>[COLOR=#000000]}[/COLOR]</p>
<p>function buildMenu[COLOR=#000000]([/COLOR]timeline, [COLOR=#0000ff]data[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> [COLOR=#808080]//</p>[/COLOR]
<p> [COLOR=#0000ff]level[/COLOR] = [COLOR=#000080]0[/COLOR];</p>
<p> pagew = [COLOR=#000080]100[/COLOR];</p>
<p> pageh = [COLOR=#000080]100[/COLOR];</p>
<p> positions = [COLOR=#000000][[/COLOR][COLOR=#000000]{[/COLOR]x:[COLOR=#000080]2[/COLOR], y:[COLOR=#000080]2[/COLOR][COLOR=#000000]}[/COLOR], [COLOR=#000000]{[/COLOR]x:[COLOR=#000080]2[/COLOR], y:[COLOR=#000080]1[/COLOR][COLOR=#000000]}[/COLOR], [COLOR=#000000]{[/COLOR]x:[COLOR=#000080]1[/COLOR], y:[COLOR=#000080]2[/COLOR][COLOR=#000000]}[/COLOR], [COLOR=#000000]{[/COLOR]x:[COLOR=#000080]1[/COLOR], y:[COLOR=#000080]1[/COLOR][COLOR=#000000]}[/COLOR], [COLOR=#000000]{[/COLOR]x:[COLOR=#000080]0[/COLOR], y:[COLOR=#000080]2[/COLOR][COLOR=#000000]}[/COLOR], [COLOR=#000000]{[/COLOR]x:[COLOR=#000080]0[/COLOR], y:[COLOR=#000080]1[/COLOR][COLOR=#000000]}[/COLOR], [COLOR=#000000]{[/COLOR]x:[COLOR=#000080]2[/COLOR], y:[COLOR=#000080]0[/COLOR][COLOR=#000000]}[/COLOR][COLOR=#000000]][/COLOR];</p>
<p> [COLOR=#808080]//</p>[/COLOR]
<p> timeline.[COLOR=#0000ff]setMask[/COLOR]COLOR=#000000[/COLOR];</p>
<p> [COLOR=#808080]//</p>[/COLOR]
<p> </p>
<p> timeline.[COLOR=#000080]destx[/COLOR] = timeline.[COLOR=#000080]desty[/COLOR]=[COLOR=#000080]10[/COLOR];</p>
<p> timeline.[COLOR=#000080]desth[/COLOR] = timeline.[COLOR=#000080]destw[/COLOR]=[COLOR=#000080]300[/COLOR];</p>
<p> [COLOR=#808080]//</p>[/COLOR]
<p> timeline.[COLOR=#000080]label[/COLOR] = [COLOR=#ff0000]“perceptive planning”[/COLOR];</p>
<p> timeline.[COLOR=#000080]bg_mc[/COLOR].[COLOR=#0000ff]onPress[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> main_mc.[COLOR=#000080]tween[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000][[/COLOR][COLOR=#ff0000]"_width"[/COLOR], [COLOR=#ff0000]"_height"[/COLOR], [COLOR=#ff0000]"_x"[/COLOR], [COLOR=#ff0000]"_y"[/COLOR][COLOR=#000000]][/COLOR], [COLOR=#000000][[/COLOR][COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]_parent[/COLOR].[COLOR=#000080]destw[/COLOR], [COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]_parent[/COLOR].[COLOR=#000080]desth[/COLOR], [COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]_parent[/COLOR].[COLOR=#000080]destx[/COLOR], [COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]_parent[/COLOR].[COLOR=#000080]desty[/COLOR][COLOR=#000000]][/COLOR], [COLOR=#000080]1[/COLOR][COLOR=#000000])[/COLOR];</p>
<p> [COLOR=#000000]}[/COLOR];</p>
<p> timeline.[COLOR=#000080]bg_mc[/COLOR].[COLOR=#0000ff]_alpha[/COLOR] = [COLOR=#000080]40[/COLOR];</p>
<p> createPages[COLOR=#000000]([/COLOR]timeline, [COLOR=#0000ff]data[/COLOR][COLOR=#000000])[/COLOR];</p>
<p>[COLOR=#000000]}[/COLOR]</p>
<p>function createPages[COLOR=#000000]([/COLOR]basepage, [COLOR=#0000ff]data[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> [COLOR=#808080]// compute scale</p>[/COLOR]
<p> [COLOR=#808080]// attach clips</p>[/COLOR]
<p> [COLOR=#0000ff]for[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#000000]var[/COLOR] i = [COLOR=#000080]0[/COLOR]; i<data.[COLOR=#0000ff]length[/COLOR]; i++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> [COLOR=#000000]var[/COLOR] page = basePage.[COLOR=#0000ff]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]“page”[/COLOR], [COLOR=#ff0000]“page”[/COLOR]+i+[COLOR=#ff0000]"_mc"[/COLOR], basepage.$depth++[COLOR=#000000])[/COLOR];</p>
<p> page.$depth = [COLOR=#000080]0[/COLOR];</p>
<p> [COLOR=#808080]//</p>[/COLOR]
<p> page.[COLOR=#0000ff]_x[/COLOR] = positions[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR].[COLOR=#000080]x[/COLOR]pagew;</p>
<p> page.[COLOR=#0000ff]_y[/COLOR] = positions[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR].[COLOR=#000080]y[/COLOR]pageh;</p>
<p> page.[COLOR=#0000ff]_width[/COLOR] = pagew;</p>
<p> page.[COLOR=#0000ff]_height[/COLOR] = pageh;</p>
<p> [COLOR=#808080]//</p>[/COLOR]
<p> page.[COLOR=#000080]label[/COLOR] = [COLOR=#0000ff]data[/COLOR][COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR].[COLOR=#000080]label[/COLOR];</p>
<p> [COLOR=#808080]//</p>[/COLOR]
<p> [COLOR=#000000]var[/COLOR] pt = [COLOR=#000000]{[/COLOR]x:[COLOR=#000080]10[/COLOR], y:[COLOR=#000080]10[/COLOR][COLOR=#000000]}[/COLOR];</p>
<p> page.[COLOR=#0000ff]globalToLocal[/COLOR]COLOR=#000000[/COLOR];</p>
<p> page.[COLOR=#000080]destx[/COLOR] = pt.[COLOR=#000080]x[/COLOR]+[COLOR=#000080]10[/COLOR];</p>
<p> page.[COLOR=#000080]desty[/COLOR] = pt.[COLOR=#000080]y[/COLOR]+[COLOR=#000080]10[/COLOR];</p>
<p> [COLOR=#808080]//</p>[/COLOR]
<p> page.[COLOR=#000080]desth[/COLOR] = page.[COLOR=#000080]destw[/COLOR]=[COLOR=#0000ff]Math[/COLOR].[COLOR=#0000ff]pow[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000080]3[/COLOR], [COLOR=#0000ff]level[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000080]900[/COLOR];</p>
<p> [COLOR=#808080]//</p>[/COLOR]
<p> page.[COLOR=#000080]bg_mc[/COLOR].[COLOR=#0000ff]_alpha[/COLOR] = [COLOR=#000080]20[/COLOR]+COLOR=#000000[/COLOR];</p>
<p> page.[COLOR=#000080]bg_mc[/COLOR].[COLOR=#0000ff]onPress[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> goToPageCOLOR=#000000[/COLOR];</p>
<p> [COLOR=#000000]}[/COLOR];</p>
<p> [COLOR=#808080]//</p>*[/COLOR]
<p> [COLOR=#0000ff]if[/COLOR] COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> [COLOR=#0000ff]level[/COLOR]++;</p>
<p> createPagesCOLOR=#000000[/COLOR];</p>
<p> level–;</p>
<p> [COLOR=#000000]}[/COLOR]</p>
<p> [COLOR=#000000]}[/COLOR]</p>
<p>[COLOR=#000000]}[/COLOR]</p>
<p>function goToPageCOLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> [COLOR=#0000ff]if[/COLOR] [COLOR=#000000]([/COLOR]page != zoomed[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> main_mc.[COLOR=#000080]tween[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000][[/COLOR][COLOR=#ff0000]"_width"[/COLOR], [COLOR=#ff0000]"_height"[/COLOR], [COLOR=#ff0000]"_x"[/COLOR], [COLOR=#ff0000]"_y"[/COLOR][COLOR=#000000]][/COLOR], [COLOR=#000000][[/COLOR]page.[COLOR=#000080]destw[/COLOR], page.[COLOR=#000080]desth[/COLOR], page.[COLOR=#000080]destx[/COLOR], page.[COLOR=#000080]desty[/COLOR][COLOR=#000000]][/COLOR],[COLOR=#000080]1[/COLOR],[COLOR=#ff0000]“easeinoutsine”[/COLOR][COLOR=#000000])[/COLOR];</p>
<p> zoomed = page;</p>
<p> [COLOR=#000000]}[/COLOR] [COLOR=#0000ff]else[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> goToPageCOLOR=#000000[/COLOR]</p>
<p> [COLOR=#000000]}[/COLOR]</p>
<p>[COLOR=#000000]}[/COLOR]</p>
<p>
[/LEFT]
[/FONT]
[/FONT][/COLOR]
[COLOR=black][FONT=Arial]
<menu>
<item>
<label>about us</label>
<data></data>
<subitems>
<item>
<label>history 1</label>
<data></data>
<subitems>
</subitems>
</item>
<item>
<label>history 2</label>
<data></data>
<subitems>
</subitems>
</item>
<item>
<label>history 3</label>
<data></data>
<subitems>
</subitems>
</item>
<item>
<label>history 4</label>
<data></data>
<subitems>
</subitems>
</item>
</subitems>
</item>
<item>
<label>portfolio</label>
<data></data>
<subitems>
<item>
<label>portfolio 1</label>
<data></data>
<subitems>
</subitems>
</item>
<item>
<label>portfolio 2</label>
<data></data>
<subitems>
</subitems>
</item>
<item>
<label>portfolio 3</label>
<data></data>
<subitems>
<item>
<label>portfolio 3a</label>
<data></data>
<subitems>
</subitems>
</item>
<item>
<label>portfolio 3b</label>
<data></data>
<subitems>
</subitems>
</item>
<item>
<label>portfolio 3c</label>
<data></data>
<subitems>
</subitems>
</item>
</subitems>
</item>
</subitems>
</item>
<item>
<label>services</label>
<data></data>
<subitems>
<item>
<label>service1</label>
<data></data>
<subitems>
</subitems>
</item>
<item>
<label>service2</label>
<data></data>
<subitems>
</subitems>
</item>
<item>
<label>service3</label>
<data></data>
<subitems>
</subitems>
</item>
<item>
<label>service4</label>
<data></data>
<subitems>
</subitems>
</item>
</subitems>
</item>
<item>
<label>contact</label>
<data></data>
<subitems></subitems>
</item>
</menu>
[/FONT][/COLOR]