Welcome to TalkGraphics.com
Results 1 to 2 of 2

Thread: Dynamic Buttons

  1. #1
    Join Date
    Aug 2000
    Location
    Dallas, Tx
    Posts
    277

    Default

    I have a dynamic menu system that I just developed for a client. The movie clip buttons dynamically duplicate by the number of records pulled from the database and the button labels dynamically populate based on the values in the field.

    I ran into a problem when trying to get the buttons to actually do something when pressed. I figured I could just code the button actions to pull the data the same way as I populated the button labels. The button lables populate from a field called "Cat" and the action should be pulled from a field called "CatLink". The "CatLink" field holds the value of the .swf file to load into the movie.

    The following code is what I used to populate the lables:

    thisClip.Button_txt.text = result.items[i].Cat;

    Here is what I've used to TRY and set the actions:

    _root["button"+i].onRelease = function() {
    loadMovieNum(result.items[i].CatLink,1);
    }

    If anyone has ran into this situation, or know some way to make this work, your help will be much appreciated.

    Thanks in advance,

    Scott
    IP

  2. #2
    Join Date
    Aug 2000
    Location
    Toronto, Ontario, Canada
    Posts
    432

    Default

    um...correct me if i'm wrong, but shouldn't that be eval("_root.button" + i + ".onrelease = function() {...}");

    the eval may end up working for you. also, didn't you name your buttons button_[i], not button[i]?

    i'm tired, so i could be off, but these might be worth looking into


    hth,
    Deep (just a guy)
    <font face="arial" size="2">
    Pradeep Kumar Nair, B.Math
    Manager, Front-End Technologies
    http://www.bluespark.com
    ICQ: 39102360
    </font>
    hth,
    Deep (just a guy)
    --
    Pradeep Kumar Nair, B.Math
    CTO
    9 Story Entertainment
    http://www.9story.com
    IP

 

 

Bookmarks

Posting Permissions

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