A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: Controling dynamic text in movieclip

Threaded View

  1. #1
    Junior Member
    Join Date
    May 2008
    Posts
    19

    Controling dynamic text in movieclip

    I am making a flash gallery using a tutorial I found. Under each picture in the gallery, I want text to display a catalog number, incremented by 1 each time.

    I have figured out how to attach a movie clip repeatedly under each picture that contains a dynamic text box. But I'm having trouble getting the dynamic text to update.

    My dynamic text box is within a movieclip called catalog. The instance name for the text box is called catalogtext.

    Can someone tell me how to tell the dynamic text box inside the movie clip catalog to return the value of i?

    All script is in the first frame of my main timeline:


    this.createEmptyMovieClip("container",1);
    var imagesNumber:Number = 9;
    var scrolling:Boolean = true;


    for (i=1; i<=imagesNumber; i++) {
    container.attachMovie("thumb"+i,"thumb"+i+"_mc",i) ;
    container.attachMovie("catalog","catalog"+i+"_mc", i+200);
    myThumb_mc = container["thumb"+i+"_mc"];
    myThumb_mc._x = (i-1)*myThumb_mc._width;
    myThumb_mc._y = (Stage.height-myThumb_mc._height)/2;
    mycatalog_mc = container["catalog"+i+"_mc"];
    mycatalog_mc._x = (i-1)*myThumb_mc._width;
    mycatalog._y = (Stage.height-myThumb_mc._height)/2;

    this["catalog"+i+"_mc"].catalogtext.text = i; // tell each instance of catalogtext to return the value of i.
    Last edited by katiekatie; 11-03-2009 at 06:14 PM.

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