A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Dynamic Menu in MX

  1. #1

    I have a text file which contains a variable, 'items', which tells the movie how many text fields to display. I have loaded the variable into the movie, now how do I get this variable to display the (X) amount of text fields??????

    Someone pleeeease help!?!

  2. #2
    Senior Member
    Join Date
    May 2002
    The Great Northwest

    Cool ABC

    If I understand you correctly you just want to display the value of a variable?

    You could do a trace to see the value in the development environment.

    or you could set the text of a dynamic text field to be equal to that value.

    _root.myTextField.text = items;
    If I didn't understand you correctly please reply.

  3. #3
    hey - thanx for getting back. maybe i should have explained clearer: what the items variable does is tell the movie how many fields to display.

    each field contains a variable, but the 'items' variable is just to tell how many fields must be displayed. Each field is a menu item, and sometimes new menu items must be added, so 'item' merely states how many menu items (fields) to display.

    Is there an actionscript which will perform this?

  4. #4
    Senior Member
    Join Date
    May 2002
    The Great Northwest


    If you are using a drop down menu there are a bunch of functions that would be helpful. If you made your own menu I am not sure how it is set up.

    Drop-down menu (list box)
    you could use myListBox.addItem(label [, data]);

    for(i=0;i < items;i++){
       myListBox.addItem(itemsArray[ i ]);
    Sorry if I am not helping. I might not be understanding you still. If you need more help you could always post a .fla

  5. #5
    Join Date
    Apr 2002

    this is a little movie i made up which generates a menu based on the number of elements in an array (label and data).

    to customise it for your use, all you have to do is change the mc Button to whatever your button is and put the correct info in the array. there's more complete instructions in the .fla.


  6. #6
    Thanx GG and Ben, I think the movie Ben linked to was appropriate so I'm learning something from that. Cheers for the help guys

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