dcsimg
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: dynamic menu help

  1. #1
    Member
    Join Date
    Jul 2003
    Posts
    36

    dynamic menu help

    I'm am going crazy trying to get this to work.
    Here is my code (i've also attached the fla, so you can see the problem)

    I am trying to attach menu1 to box1 and menu2 to box2. but menu1 ends up on the main timeline and menu2 ends up on box2.

    Any input would be great, thanks

    code:

    menu1 = new Array('menu1link1','menu1link2','menu1link3');
    menu2 = new Array('menu2link1','menu2link2');
    subMenus = new Array(menu1, menu2);


    for(var i=0; i<subMenus.length; i++){
    for(var j=0; j<subMenus[i].length; j++){
    this.createEmptyMovieClip('box'+i, this.getNextHighestDepth());
    linkInstance = _root['box'+i].attachMovie('menuItem', i+"link"+j, this.getNextHighestDepth());
    linkInstance.name.text = subMenus[i][j];
    linkInstance.trackAsMenu = true;
    linkInstance._x = linkInstance._x;
    linkInstance._y += j*linkInstance._height;
    trace(linkInstance._name);
    }
    }

    Attached Files Attached Files

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397

    So that you know...

    Unexpected file format! Can't open your .fla.
    You'd have a better chance of getting an answer if your .fla was in a MX only format.

    You would have to save a copy of your MX2004 .fla, (using Save as...) and changing the Document type to MX only in the Save as... window.

  3. #3
    Member
    Join Date
    Jul 2003
    Posts
    36
    sorry about that
    Attached Files Attached Files

  4. #4
    Member
    Join Date
    Jul 2003
    Posts
    36
    did that file work?

  5. #5
    Member
    Join Date
    Jul 2003
    Posts
    36
    here is a revised file.
    I get it to work, but it only puts the last link of each array into its box.
    Attached Files Attached Files

  6. #6
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    This?

    Attachment removed.
    Last edited by oldnewbie; 01-29-2005 at 11:26 PM.

  7. #7
    Member
    Join Date
    Jul 2003
    Posts
    36
    yeah, thats what i was trying to do.
    Thanks, what was i doing wrong? looks like getNextHighestDepth was screwing it up

  8. #8
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Well, it's supposed to on MX2004, but is not available on Flash MX only, so it wasn't working for me at least!

  9. #9
    Member
    Join Date
    Jul 2003
    Posts
    36
    ok, thanks again for your help and quick responses

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