Welcome to TalkGraphics.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2000
    Location
    Dallas, Tx
    Posts
    277

    Default

    Can anyone tell me what I'm doing wrong? Working with Flash MX, I have a movie clip (instance of btn_mc) that serves as a button. It reads from a text file (names.txt) for the values to display on the MC button. I'm trying to make the movie clip duplicate by the button height for each value in the text file. It seems to duplicate but it looks like they stack on top of each other and no values display from the text file. The following is the code I've written:
    --------------------------------------------------
    btn_mc._visible=false;
    nameData = new LoadVars();
    nameData.load("names.txt");
    nameData.onLoad = function()
    {
    nameArray = this.names.split(",");
    numItems = nameArray.length
    for(var i=0;i<numItems;i++);
    {
    btn_mc.duplicateMovieClip("button"+i,i+1);
    thisClip = _root["button"+i];
    if(i>0)
    {
    lastClip=_root["button"+(i-1)];
    thisClip._y = lastClip._y + lastClip.height;
    thisClip.name_text.textnameArray[i];
    }
    }
    --------------------------------------------------
    Thanks for any help,

    Scott
    IP

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

    Default

    Can anyone tell me what I'm doing wrong? Working with Flash MX, I have a movie clip (instance of btn_mc) that serves as a button. It reads from a text file (names.txt) for the values to display on the MC button. I'm trying to make the movie clip duplicate by the button height for each value in the text file. It seems to duplicate but it looks like they stack on top of each other and no values display from the text file. The following is the code I've written:
    --------------------------------------------------
    btn_mc._visible=false;
    nameData = new LoadVars();
    nameData.load("names.txt");
    nameData.onLoad = function()
    {
    nameArray = this.names.split(",");
    numItems = nameArray.length
    for(var i=0;i<numItems;i++);
    {
    btn_mc.duplicateMovieClip("button"+i,i+1);
    thisClip = _root["button"+i];
    if(i>0)
    {
    lastClip=_root["button"+(i-1)];
    thisClip._y = lastClip._y + lastClip.height;
    thisClip.name_text.textnameArray[i];
    }
    }
    --------------------------------------------------
    Thanks for any help,

    Scott
    IP

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

    Default

    <pre class="ip-ubbcode-code-pre">thisClip.name_text.textnameArray[i];</pre>

    um, shouldn't that be:

    <pre class="ip-ubbcode-code-pre">thisClip.name_text.text = nameArray[i];</pre>

    also, do you have a dynamic text field named "name_text" inside btn_mc?

    you may want to trace the value of nameArray just to see that it is actually reading the array okay. other than that, the code looks okay to me. what do you see when you try to load the variables?


    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

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

    Default

    You know, sometimes the most obvious things can get you. I looked over that a million times and that never jumped out at me. I guess that's where it pays off to have a second set of eyes look at the problem.

    Thanks a million Deep!

    Scott
    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
  •