A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: My buttons wont' populate and I have no clue why

  1. #1
    Spidey wants his icon back! Defyeler's Avatar
    Join Date
    Jul 2002
    Location
    New York City
    Posts
    255

    My buttons wont' populate and I have no clue why

    My buttons won't populate.. I'm obtaining the variables thru XML data, everything else in the damn thing works fine, so I know the data is loading correctly, but my buttons won't populate.. I'm wondering if anyone sees something wrong in my code cause I don't see it.. thanks

    PHP Code:
    function buildMenu(){
        
    tiles = new Array();
        for (
    i=0menuItems.lengthi++) {
            
    duplicateMovieClip(master"tile" i1000 i);
            
    tiles[i] = this["tile" +i];
    //set the master tile position with XML data
            
    tiles[i]._x Number(menu.attributes.x);
            
    tiles[i]._y Number(menu.attributes.y) + (master._height);
            
    tiles[i].title "<P ALIGN=\"CENTER\"><FONT FACE=\"" menuItems[i].fontFace "\" SIZE=\"" menuItems[i].fontSize "\" COLOR=\"#" menuItems[i].textColor "\">" menuItems[i].Artist "</FONT></P>"
            
    tiles[i]._name menuItems[i].title.substr(04);
    //sets the index value to i so it will work with our internal Array and XML
    //sets an i to id so it can be called from our XML playlist Array
            
    tiles[i].index i;
            
    tiles[i].id i;
        }
        
    loadTrack(index);
        
    playlistmenu.setScrollContent("menu");

    Its never.. wow kool I like it, its always.. ok I made this.. how can it be better?

  2. #2
    Spidey wants his icon back! Defyeler's Avatar
    Join Date
    Jul 2002
    Location
    New York City
    Posts
    255
    nvm I fixed it.

    my menu.attribute.x and y coordinates were pionting out in space lol...
    Its never.. wow kool I like it, its always.. ok I made this.. how can it be better?

  3. #3
    Senior Member
    Join Date
    Feb 2003
    Posts
    825
    Try changing tile to tiles:

    tiles[i] = this["tile" +i];

    to

    tiles[i] = this["tiles" +i];

  4. #4
    Spidey wants his icon back! Defyeler's Avatar
    Join Date
    Jul 2002
    Location
    New York City
    Posts
    255
    oh, tiles and tile are two different things

    tiles is the new name for the button

    tile is the new instance name for the button, they cannot be the same.

    The script above makes a series of buttons called

    tiles with instance names of tile

    so if i had 4 buttons they would be

    tiles1 with instance name of tile1
    tiles2 with instance name of tile2
    tiles3 with instance name of tile3
    tiles4 with instance name of tile4

    they can't be the same because I'm assigning the buttons to a scrollpane also.
    Its never.. wow kool I like it, its always.. ok I made this.. how can it be better?

  5. #5
    FK's Giant Steve_w_V's Avatar
    Join Date
    Mar 2003
    Location
    San Jose, California
    Posts
    2,113
    But the name of the duplicated movie clip is "tile" plus i. "tiles" is the array name.

    -edit-

    But I see you already answered....
    The other day, I bought a box of animal crackers. On the side, it said "Do Not Eat if Seal is Broken". I opened the box and sure enough...

  6. #6
    Senior Member
    Join Date
    Feb 2003
    Posts
    825
    maybe try removing the quotes from tile...?

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