# Iterations are weird... (help!)

**URL:** <https://forum.kirupa.com/t/iterations-are-weird-help/236338>\
**Category:** Uncategorized\
**Created:** [August 20, 2007, 3:17am UTC](https://forum.kirupa.com/t/iterations-are-weird-help/236338 "2007-08-20T03:17:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![azdak](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@azdak](https://forum.kirupa.com/u/azdak)\
**Post date:** [August 20, 2007, 3:17am UTC](https://forum.kirupa.com/t/iterations-are-weird-help/236338/1 "2007-08-20T03:17:06Z")

</div>

ok then… if anybody can help me with this, it’d be amazing…  
I’m using the standard for loop to make an xml menu, but having problems including a color tween… the relevant code exceprts:

```
 ActionScript Code:
 [FONT=Courier New][LEFT][COLOR=#0000ff]for[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#000000] **var** [/COLOR] i = [COLOR=#000080]0[/COLOR]; i&lt;basenode.[COLOR=#0000ff]length[/COLOR]; i++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
    [COLOR=#000000] **var** [/COLOR] nodeinfo = basenode[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR];
    [COLOR=#000000] **var** [/COLOR] current_mc = [COLOR=#0000ff]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]"menuitem"[/COLOR], [COLOR=#ff0000]"menuitem"[/COLOR]+i, i[COLOR=#000000])[/COLOR];

```

[COLOR=#808080]_/// colour tweening_[/COLOR]  
current\_mc.[COLOR=#000080]offcolour[/COLOR] = [COLOR=#000000] **new** [/COLOR] ColourCOLOR=#000000[/COLOR];  
current\_mc.[COLOR=#000080]oncolour[/COLOR] = [COLOR=#000000] **new** [/COLOR] ColourCOLOR=#000000[/COLOR];

```
    current_mc.[COLOR=#000080]ct[/COLOR] = [COLOR=#000000] **new** [/COLOR] ColorTransform[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
    current_mc.[COLOR=#000080]redOffsetTween[/COLOR] = [COLOR=#000000] **new** [/COLOR] Tween[COLOR=#000000]([/COLOR]current_mc.[COLOR=#000080]ct[/COLOR], [COLOR=#ff0000]"redOffset"[/COLOR], [COLOR=#000000] **null** [/COLOR], [COLOR=#000080]0[/COLOR], [COLOR=#000080]0[/COLOR], [COLOR=#000080]1[/COLOR], [COLOR=#000000] **true** [/COLOR][COLOR=#000000])[/COLOR];
    current_mc.[COLOR=#000080]greenOffsetTween[/COLOR] = [COLOR=#000000] **new** [/COLOR] Tween[COLOR=#000000]([/COLOR]current_mc.[COLOR=#000080]ct[/COLOR], [COLOR=#ff0000]"greenOffset"[/COLOR], [COLOR=#000000] **null** [/COLOR], [COLOR=#000080]0[/COLOR], [COLOR=#000080]0[/COLOR], [COLOR=#000080]1[/COLOR], [COLOR=#000000] **true** [/COLOR][COLOR=#000000])[/COLOR];
    current_mc.[COLOR=#000080]blueOffsetTween[/COLOR] = [COLOR=#000000] **new** [/COLOR] Tween[COLOR=#000000]([/COLOR]current_mc.[COLOR=#000080]ct[/COLOR], [COLOR=#ff0000]"blueOffset"[/COLOR], [COLOR=#000000] **null** [/COLOR], [COLOR=#000080]0[/COLOR], [COLOR=#000080]0[/COLOR], [COLOR=#000080]1[/COLOR], [COLOR=#000000] **true** [/COLOR][COLOR=#000000])[/COLOR];
    current_mc.[COLOR=#000080]redOffsetTween[/COLOR].[COLOR=#000080]onMotionChanged[/COLOR] = [COLOR=#000000] **function** [/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
        current_mc.[COLOR=#000080]transform[/COLOR].[COLOR=#000080]colorTransform[/COLOR] = current_mc.[COLOR=#000080]ct[/COLOR];
    [COLOR=#000000]}[/COLOR];
    current_mc.[COLOR=#0000ff]onRollOver[/COLOR] = [COLOR=#000000] **function** [/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
        [COLOR=#0000ff]this[/COLOR].[COLOR=#000080]redOffsetTween[/COLOR].[COLOR=#000080]continueTo[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]this[/COLOR].[COLOR=#000080]oncolour[/COLOR].[COLOR=#000080]red[/COLOR],[COLOR=#000080]1[/COLOR][COLOR=#000000])[/COLOR];
        [COLOR=#0000ff]this[/COLOR].[COLOR=#000080]greenOffsetTween[/COLOR].[COLOR=#000080]continueTo[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]this[/COLOR].[COLOR=#000080]oncolour[/COLOR].[COLOR=#000080]green[/COLOR],[COLOR=#000080]1[/COLOR][COLOR=#000000])[/COLOR];
        [COLOR=#0000ff]this[/COLOR].[COLOR=#000080]blueOffsetTween[/COLOR].[COLOR=#000080]continueTo[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]this[/COLOR].[COLOR=#000080]oncolour[/COLOR].[COLOR=#000080]blue[/COLOR],[COLOR=#000080]1[/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#000000]}[/COLOR];
    current_mc.[COLOR=#0000ff]onRollOut[/COLOR] = [COLOR=#000000] **function** [/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
        [COLOR=#0000ff]this[/COLOR].[COLOR=#000080]redOffsetTween[/COLOR].[COLOR=#000080]continueTo[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]this[/COLOR].[COLOR=#000080]offcolur[/COLOR].[COLOR=#000080]red[/COLOR],[COLOR=#000080]1[/COLOR][COLOR=#000000])[/COLOR];
        [COLOR=#0000ff]this[/COLOR].[COLOR=#000080]greenOffsetTween[/COLOR].[COLOR=#000080]continueTo[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]this[/COLOR].[COLOR=#000080]offcolour[/COLOR].[COLOR=#000080]green[/COLOR],[COLOR=#000080]1[/COLOR][COLOR=#000000])[/COLOR];
        [COLOR=#0000ff]this[/COLOR].[COLOR=#000080]blueOffsetTween[/COLOR].[COLOR=#000080]continueTo[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]this[/COLOR].[COLOR=#000080]offcolour[/COLOR].[COLOR=#000080]blue[/COLOR],[COLOR=#000080]1[/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#000000]}[/COLOR];

```

[COLOR=#808080]_/// end colour tweening_[/COLOR]  
current\_mc.[COLOR=#0000ff]onRelease[/COLOR] = [COLOR=#000000] **function** [/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]  
image\_holder.[COLOR=#0000ff]loadMovie[/COLOR]COLOR=#000000[/COLOR];  
content.[COLOR=#0000ff]text[/COLOR] = [COLOR=#0000ff]this[/COLOR].[COLOR=#000080]descrip[/COLOR];  
[COLOR=#000000] **var** [/COLOR] launchurl = [COLOR=#0000ff]this[/COLOR].[COLOR=#000080]link[/COLOR];

```
        [COLOR=#0000ff]if[/COLOR] [COLOR=#000000]([/COLOR]launchurl != [COLOR=#ff0000]"none"[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
            launch.[COLOR=#0000ff]_visible[/COLOR] = [COLOR=#000000] **true** [/COLOR];
            launch.[COLOR=#0000ff]onRelease[/COLOR] = [COLOR=#000000] **function** [/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
                [COLOR=#808080]*//getURL(current_mc.link, "_blank");*[/COLOR]
                [COLOR=#0000ff]trace[/COLOR][COLOR=#000000]([/COLOR]launchurl[COLOR=#000000])[/COLOR];
            [COLOR=#000000]}[/COLOR];
        [COLOR=#000000]}[/COLOR] [COLOR=#0000ff]else[/COLOR] [COLOR=#000000]{[/COLOR]
            launch.[COLOR=#0000ff]_visible[/COLOR] = [COLOR=#000000] **false** [/COLOR];
        [COLOR=#000000]}[/COLOR]
    [COLOR=#000000]}[/COLOR];
[COLOR=#000000]}[/COLOR]

```

[COLOR=#000000]}[/COLOR]  
[/LEFT]  
[/FONT]

(I’m using [canadian’s custom colour class](http://www.kirupa.com/forum/showthread.php?t=223418&highlight=colour), by the way, but i’m pretty sure that’s not the problem)

When I run the thing, only the last menu item created responds to the code; I feel like I’m missing something obvious… then again, maybe not.  
Ideas?
