A3 Arrays of movieClips

[COLOR=#000000][FONT=Arial]AS3.0] I’m currently working on my graduation diploma and I have a problem with managing movieClips with the same instance name…sort of. I’m creating an array of objects with this Class an Arrays in frame 1:[/FONT][/COLOR]

[COLOR=#00008B]package[/COLOR] 
{
[COLOR=#00008B]import[/COLOR] flash.display.[COLOR=#2B91AF]MovieClip[/COLOR];

    [COLOR=#00008B]public[/COLOR] [COLOR=#00008B]class[/COLOR] createFractionBuilding
    {
        [COLOR=#00008B]public[/COLOR] [COLOR=#00008B]function[/COLOR] createFractionBuilding(_fractionBuildingMovieClip:[COLOR=#2B91AF]MovieClip[/COLOR], _fractionBuildingLevel:[COLOR=#2B91AF]Number[/COLOR],_fractionBuildingCost:[COLOR=#2B91AF]Number[/COLOR], _fractionBuildingFrame:[COLOR=#2B91AF]Number[/COLOR])
            {
            fractionBuildingLevel = _fractionBuildingLevel;
            fractionBuildingCost = _fractionBuildingCost;
            fractionBuildingMovieClip = _fractionBuildingMovieClip
            fractionBuildingFrame = -fractionBuildingFrame

        }

    [COLOR=#00008B]public[/COLOR] [COLOR=#00008B]var[/COLOR] fractionBuildingLevel:[COLOR=#2B91AF]Number[/COLOR],fractionBuildingCost:[COLOR=#2B91AF]Number[/COLOR],fractionBuildingFrame:[COLOR=#2B91AF]Number[/COLOR];
    [COLOR=#00008B]public[/COLOR] [COLOR=#00008B]var[/COLOR] fractionBuildingMovieClip:[COLOR=#2B91AF]MovieClip[/COLOR]
    }
}

[COLOR=#000000][FONT=Arial]On main timeline I’m refering to this Class by creating an Array of objects:[/FONT][/COLOR]

[COLOR=#00008B]var[/COLOR] allHumanBuildingsList:[COLOR=#2B91AF]Array[/COLOR] = [COLOR=#00008B]new[/COLOR] [COLOR=#2B91AF]Array[/COLOR]();

[COLOR=#00008B]var[/COLOR] humanCapitolBuildingProperties:createFractionBuilding = [COLOR=#00008B]new[/COLOR] createFractionBuilding(humanCapitol_mc,[COLOR=#800000]1[/COLOR],[COLOR=#800000]1000[/COLOR],[COLOR=#800000]1[/COLOR]);
[COLOR=#00008B]var[/COLOR] humanCastleBuildingProperties:createFractionBuilding = [COLOR=#00008B]new[/COLOR] createFractionBuilding(humanCastle_mc,[COLOR=#800000]2[/COLOR],[COLOR=#800000]1000[/COLOR],[COLOR=#800000]1[/COLOR]);

allHumanBuildingsList.push(humanCapitolBuildingProperties);
allHumanBuildingsList.push(humanCastleBuildingProperties);

[COLOR=#000000][FONT=Arial]For this to work I have to have movieclip called “humanCapitol_mc” or “humanCastle_mc” in this frame (1).[/FONT][/COLOR]
[COLOR=#000000][FONT=Arial]But in frame (2) I want to refer to this movieClip with such function:[/FONT][/COLOR]

[COLOR=#00008B]function[/COLOR] humanBuildingLevelCheck()
{
    [COLOR=#00008B]for[/COLOR] ([COLOR=#00008B]var[/COLOR] a:[COLOR=#2B91AF]Number[/COLOR] = [COLOR=#800000]0[/COLOR]; a < allHumanBuildingsList.length; a++)
    {
    trace ([COLOR=#2B91AF]String[/COLOR](allHumanBuildingsList[a].fractionBuildingMovieClip))
    [COLOR=#00008B]if[/COLOR] (allHumanBuildingsList[a].fractionBuildingLevel == [COLOR=#800000]2[/COLOR]){
        allHumanBuildingsList[a].fractionBuildingMovieClip.gotoAndStop([COLOR=#800000]3[/COLOR])
    } [COLOR=#00008B]else[/COLOR] [COLOR=#00008B]if[/COLOR] (allHumanBuildingsList[a].fractionBuildingLevel == [COLOR=#800000]1[/COLOR]){
            allHumanBuildingsList[a].fractionBuildingMovieClip.gotoAndStop([COLOR=#800000]2[/COLOR])
        }

    }

}
humanBuildingLevelCheck()

[COLOR=#000000][FONT=Arial](Each MovieClip on first frame is blank, on second is one picture, on third is different one)[/FONT][/COLOR]
[COLOR=#000000][FONT=Arial]Everything works, when the array creation code is in frame two, but it won’t work the way I want: first I create variables and objects and then I change it’s values dynamicly. Do you have an idea, how could that work?[/FONT][/COLOR]