A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Not sure why attachMovie clip isnt working in this instance

  1. #1
    Junior Member
    Join Date
    Oct 2003
    Posts
    3

    Not sure why attachMovie clip isnt working in this instance

    The line: topSubNav.attachMovie("subText", "subText"+y, 0);

    doesnt seem to be working correctly. The spelling is correct.
    I am trying to attach a movie clip inside movieclip: topSubNav

    anyIdeas?

    __________________________________________________ ____________

    for(x=0; x<3; x++) {
    for(y=0; y<2; y++) {
    topSubNav.attachMovie("subText", "subText"+y, 0);
    trace("name"+this._name)
    topSubNav.eval("subText"+y)._x = orgX;
    topSubNav.eval("subText"+y)._y = orgY;
    topSubNav.eval("subText"+y).label.htmlText = topLevel[x][y];
    trace("topLevel[x][y]" + topSubNav.eval("subText"+y)._y);
    topSubNav.navBGobj._height += 25;
    }
    this.attachMovie("topLevelItem","item"+x, x+4);
    eval("item"+x)._y = yPos;
    eval("item"+x)._x = xPos;

    ....... yada yada yada }

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    A depth setting problem?

  3. #3
    Junior Member
    Join Date
    Oct 2003
    Posts
    3
    well incase anyone is in the least bit interested... i figured it out

    i had to put the full path in the eval() statement

    old:
    topSubNav.eval("subText"+1)._y = yada yada.....

    new:
    eval("topSubNav.subText"+1)._y = yada yada.....

    this is helpful down the road i suppose.

  4. #4
    Junior Member
    Join Date
    Oct 2003
    Posts
    3
    well incase anyone is in the least bit interested... i figured it out

    i had to put the full path in the eval() statement

    old:
    topSubNav.eval("subText"+1)._y = yada yada.....

    new:
    eval("topSubNav.subText"+1)._y = yada yada.....

    this is helpful down the road i suppose.

  5. #5
    Senior Member stoc's Avatar
    Join Date
    Nov 2001
    Location
    Romania, Arad
    Posts
    428
    topSubNav.attachMovie("subText", "subText"+y, 0);
    isnt work properly because of for (x=...) cycle.

    first :
    you "overwrite" "subText"+y at same depth = 0.

    second :
    to say , you will use instead of 0(depth), y ... the problem appear after y full cycle, because ... every time the "x" cycle is incremented ... you overwrite again subText0, subText1 in y cycle.

    I hope Im not so confused in my poor english
    Stoc Digital Studio - Web Applications Development
    http://www.stoc-studio.ro

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center