14 Replies Latest reply on Aug 7, 2009 5:08 AM by Ned Murphy

    actionscript to load captions from array to dynamic text when thumb is clicked

    a@ve-creative

      i have this code below that i made using a tutorial....it loads vars from txt file splits it then puts it into an array....once in an array it the brings the pics in from the array to create thumbnails and a larger image. my problem is i have captions to go with it and when i try to load the captions nothing happens or can be seen to be happening.

      i dont know where i am going wrong as i have no output or compiled errors

       

      
      var locVar = new Array();
      locVar = imgLoc.split(",");
      trace ( locVar );
      
      var tmbVar = new Array();
      tmbVar = tmbLoc.split(",");
      trace ( tmbVar );
      
      var capVar = new Array();
      capVar = imgCap.split(",");
      trace ( capVar );
      
      var NPICS:Number = locVar.length;     // number of pictures to load
      var PICX:Number = 32.8;               // x loc of big picture
      var PICY:Number = 24.9;               // y loc
      var THUMBHOLDERX:Number = 50;        // x location of thumbnail holder movieclip
      var THUMBHOLDERY:Number = 457;      // y location
      var THUMBW:Number = 100;             // width of each thumbnail
      var THUMBH:Number = 75;             // height
      var MARGIN:Number = 10;             // margin between thumbnails
      var TOTALBYTES:Number = 212000;     // approx sum of bytes in all jpgs (x 2)
      var MAXPIXELS:Number = 12;          // max number of pixels to move slider per frame
      
      // mask definition; mask is assumed to cover some part of the thumbnail slider (here the numbers
      // were chosen so that there are margins between the mask and the right and left edges of the movie
      // (which is 420 x 290), and enough space above and below the thumbs to show them when they 'grow'
      // on mouseover
      var MASKX:Number = 0;                    // start x location of mask
      var MASKW:Number = 600;                    // mask width
      var MASKY:Number = 447.9;                    // start y location of mask
      var MASKH:Number = 92;                    // mask height
      
      var totalloaded:Number = 0;         // running tally of bytes loaded from all pics
      
      // index into pictures array, used for loading
      var ipic:Number;
      
      // set up loader, an instance of MovieClipLoader
      var loader:MovieClipLoader = new MovieClipLoader();
      
      // use the main timeline to listen to and respond to loader's broadcast events
      loader.addListener(this);
      
      // function to move thumbnail slider ("this" = thumbs_mc)
      
      function sliderControl() {
         var w:Number = this._width/2;
         var hw:Number = mask_mc._width/2;
         var npixels:Number;
         // only do when mouse over slider mask
         if (_ymouse > mask_mc._y && _ymouse < mask_mc._y + mask_mc._height) {
            // mouse over left half of slider:
            if (_xmouse > mask_mc._x && _xmouse < mask_mc._x + hw) {
               npixels = (hw - _xmouse) / hw * MAXPIXELS;
               this._x += npixels;
               if (this._x >= 0) this._x = this._x - w;
            // mouse over right half of slider:
            } else if (_xmouse > mask_mc._x + hw && _xmouse < mask_mc._x + mask_mc._width) {
               npixels = (_xmouse - hw) / hw * MAXPIXELS;
               this._x -= npixels;
               if (this._x <= -w) this._x = this._x + w;
            }
         }
      }
      
      // thumbnail click (onrelease) handler
      
      function openPic() {
         pic_mc.loadMovie(locVar[this.i]);
      }
      
      function brightON(){
           this._alpha = 300;
      }
      function brightOFF(){
           this._alpha = 30;
      }
      function captionTXT(){
           _root.cap_txt = capVar;
      }
      
      // assign event handlers (called when all jpgs are loaded)
      
      function setupHandlers() {
         pct_txt.removeTextField();          // don't need loading indicator any more
         thumbs_mc.onEnterFrame = sliderControl;
         for (var i:Number = 0; i < NPICS*2; i++) {
            thumbs_mc["mc"+i].onRollOver = brightON;
            thumbs_mc["mc"+i].onRollOut = brightOFF;
            thumbs_mc["mc"+i].onMouseDown = captionTXT;
            thumbs_mc["mc"+i].onRelease = openPic;
         }
      }
      
      // listener function for broadcast 'done' message (for each pic)
      // onLoadInit gets executed when the movieclip has been loaded into _mc AND 
      //   its width and height data are available.
      //   (_mc = the movieclip being loaded into)
      // this routine sets the size and position of each thumbnail clip as its jpg
      //   is loaded and starts the next one loading.  When all have been loaded, 
      //   a random picture is loaded into pic_mc and setupHandlers is called to 
      //   assign handlers to each thumbnail movieclip
      
      function onLoadInit(_mc:MovieClip) {
         // this gets done when the jpg is completely loaded:
         _mc._width = THUMBW;
         _mc._height = THUMBH;
         _mc._alpha = 30;          // for image clarity
         // give the movieclip a property to remind it who it is
         // (used by openPic to know which big picture to open)
         _mc.i = (ipic >= NPICS ? ipic-NPICS : ipic);
           
         // add picture size to totalloaded variable
         totalloaded += loader.getProgress(_mc).bytesTotal;
      
         // now load the next one (if there are more) or set up handlers if done
         ipic++;
         if (ipic == NPICS * 2) {
            // start with a random photo displayed when all thumbs loaded
            pic_mc.loadMovie(locVar[Math.floor(Math.random()*NPICS)]);
            setupHandlers();
         } else if (ipic >= NPICS) {
            // load jpg into duplicate thumbnail (will already be cached)
            loader.loadClip(tmbVar[ipic-NPICS],  thumbs_mc["mc"+ipic]);
         } else {
            // load jpg into thumbnail
            loader.loadClip(tmbVar[ipic],  thumbs_mc["mc"+ipic]);
         }
      }
      
      // listener function to handle broadcast progress messages
      // make pct_txt show cumulative loading progress
      
      function onLoadProgress(_mc:MovieClip, loaded:Number) {
         var loadedsofar:Number = totalloaded + loaded;     
         pct_txt.text = Math.floor(loadedsofar / TOTALBYTES * 100) + "%";
      }
      
      function init() {
         // create holder for pictures
         createEmptyMovieClip("pic_mc", 1);
         pic_mc._x = PICX;
         pic_mc._y = PICY;
      
         // create (and draw) holder for thumbnails 
         createEmptyMovieClip("thumbs_mc", 2);
         thumbs_mc.beginFill(0, 100);     // black
         thumbs_mc.moveTo(0, 0);
            thumbs_mc.lineTo(2 * (MARGIN + THUMBW) * NPICS, 0);
         thumbs_mc.lineTo(2 * (MARGIN + THUMBW) * NPICS, THUMBH);
         thumbs_mc.lineTo(0, THUMBH);
         thumbs_mc.endFill();
         // drawing the thumb holder at 0, 0 and then moving it makes its reg point = upper left
         thumbs_mc._x = THUMBHOLDERX;
         thumbs_mc._y = THUMBHOLDERY;
      
         // create, draw and enable mask over thumbs (could use different variables to define mask
         // if desired)
         createEmptyMovieClip("mask_mc", 3);
         mask_mc.beginFill(0x0000cc, 100);
         mask_mc.moveTo(0, 0);
         mask_mc.lineTo(MASKW, 0);
         mask_mc.lineTo(MASKW, MASKH);
         mask_mc.lineTo(0, MASKH);
         mask_mc.endFill();
         mask_mc._x = MASKX;
         mask_mc._y = MASKY;
         thumbs_mc.setMask(mask_mc);
      
         // create loading textfield indicator
         createTextField("pct_txt", 4, 200, 100, 40, 100);
         var tf:TextFormat = new TextFormat();
         tf.align = "center";
         tf.size = 12;
         tf.font = "Verdana";
         tf.color = 0xFFFF00;
         pct_txt.setNewTextFormat(tf);
         
         // create loading textfield indicator
         createTextField("cap_txt", 0, 400, 200, 40, 100);
         var cf:TextFormat = new TextFormat();
         cf.align = "center";
         cf.size = 12;
         cf.font = "Verdana";
         cf.color = 0xFFFF00;
         cap_txt.setNewTextFormat(cf);
      
         // make empty movieclips in thumbs_mc for each pic to go into
         // make double the number so the slider can move continuously and show content
         for (var i:Number = 0; i < NPICS * 2; i++) {
            var mc:MovieClip = thumbs_mc.createEmptyMovieClip("mc"+i, i+1);
            mc._x = i*(MARGIN + THUMBW);
            mc._y = 0;
         }
           
         // set the pointer to the first jpg in the array picnames
         ipic = 0;
         // start loading jpgs (ipic is initialized to 0)
         loader.loadClip(locVar[ipic], thumbs_mc["mc"+ipic]);
      }
      
      init();
      stop();
      
        • 1. Re: actionscript to load captions from array to dynamic text when thumb is clicked
          Ned Murphy Adobe Community Professional & MVP

          I can't find anywhere in the code where what I assume is caption text (cap_txt) being assigned any text (cap_txt.text = ???).  I see this function, but all I see that doing is assigning an array to something that shares the name of the textfield that's created elsewhere.

           

          function captionTXT(){
               _root.cap_txt = capVar;
          }

          1 person found this helpful
          • 2. Re: actionscript to load captions from array to dynamic text when thumb is clicked
            a@ve-creative Level 1

            the function is made as you saw and this is where it is used. there doesn't seem to be any errors but im wondering if i've put it on the wrong level?

             

            function setupHandlers() {
               pct_txt.removeTextField();          // don't need loading indicator any more
               thumbs_mc.onEnterFrame = sliderControl;
               for (var i:Number = 0; i < NPICS*2; i++) {
                  thumbs_mc["mc"+i].onRollOver = brightON;
                  thumbs_mc["mc"+i].onRollOut = brightOFF;
                  thumbs_mc["mc"+i].onMouseDown = captionTXT; //right here 
                  thumbs_mc["mc"+i].onRelease = openPic;
               }
            
            
            • 3. Re: actionscript to load captions from array to dynamic text when thumb is clicked
              Ned Murphy Adobe Community Professional & MVP

              As I already stated, I don't see anywhere that you actually assign any text to a textfield.  You say the function below does it, but from what I can tell it does next to nothing....

               

              function captionTXT(){
                   _root.cap_txt = capVar;
              }

               

              capVar is an array, not a String, so if your goal is to display the entire array in a textfield, assigning capVar to that textfield would do it.  But you aren't assigning it to a textfield as the text property (cap_txt.text = capVar)

               

              If that function's line was supposed to be assigning an element of the capVar array to the cap_txt textfield it should be coded something more along the lines of...

               

               

              function captionTXT(){
                   _root.cap_txt.text = capVar[selectedIndex];

                                 // where selectedIndex in defined by whatever selected the caption.
              }

              1 person found this helpful
              • 4. Re: actionscript to load captions from array to dynamic text when thumb is clicked
                a@ve-creative Level 1

                ok so that is where i am going wrong ill use a loop that i used in other functions to define that index.

                 

                last question..... if i place the text field on the stage rather than generate it with actionscript would this be better? and if so how do i make it stay at the top above all images?

                • 5. Re: actionscript to load captions from array to dynamic text when thumb is clicked
                  a@ve-creative Level 1

                  ok here is my code so far.....i've set a movieclip where i want the captions and set the dyn text box above the clip....i've given the movieclip a background n faded so images can still be seen behind.

                   

                  im just having a problem with the loop.....each one i tried resulted in the caption staying the same no matter what thumbnail is clicked.

                   

                  are there any suggestions as to how this can be done......(please bare in mind im a newbie to actionscript)

                   

                  var locVar = new Array();
                  locVar = imgLoc.split(",");
                  
                  var tmbVar = new Array();
                  tmbVar = tmbLoc.split(",");
                  
                  var capVar = new Array();
                  capVar = imgCap.split(",");
                  
                  var NPICS:Number = locVar.length;     // number of pictures to load
                  var PICX:Number = 32.8;               // x loc of big picture
                  var PICY:Number = 24.9;               // y loc
                  var THUMBHOLDERX:Number = 50;        // x location of thumbnail holder movieclip
                  var THUMBHOLDERY:Number = 457;      // y location
                  var THUMBW:Number = 100;             // width of each thumbnail
                  var THUMBH:Number = 75;             // height
                  var MARGIN:Number = 10;             // margin between thumbnails
                  var TOTALBYTES:Number = 212000;     // approx sum of bytes in all jpgs (x 2)
                  var MAXPIXELS:Number = 12;                    // max number of pixels to move slider per frame
                  var CAPSW:Number = 525;                    
                  var CAPSH:Number = 28;     
                  var CAPSX:Number = 38;            //caption text x position
                  var CAPSY:Number = 391;            //caption text y position
                  
                  // mask definition; mask is assumed to cover some part of the thumbnail slider (here the numbers
                  // were chosen so that there are margins between the mask and the right and left edges of the movie
                  // (which is 420 x 290), and enough space above and below the thumbs to show them when they 'grow'
                  // on mouseover
                  var MASKX:Number = 0;                    // start x location of mask
                  var MASKW:Number = 600;                    // mask width
                  var MASKY:Number = 447.9;                    // start y location of mask
                  var MASKH:Number = 92;                    // mask height
                  
                  var totalloaded:Number = 0;         // running tally of bytes loaded from all pics
                  
                  // index into pictures array, used for loading
                  var ipic:Number;
                  
                  // set up loader, an instance of MovieClipLoader
                  var loader:MovieClipLoader = new MovieClipLoader();
                  
                  // use the main timeline to listen to and respond to loader's broadcast events
                  loader.addListener(this);
                  
                  // function to move thumbnail slider ("this" = thumbs_mc)
                  
                  function sliderControl() {
                     var w:Number = this._width/2;
                     var hw:Number = mask_mc._width/2;
                     var npixels:Number;
                     // only do when mouse over slider mask
                     if (_ymouse > mask_mc._y && _ymouse < mask_mc._y + mask_mc._height) {
                        // mouse over left half of slider:
                        if (_xmouse > mask_mc._x && _xmouse < mask_mc._x + hw) {
                           npixels = (hw - _xmouse) / hw * MAXPIXELS;
                           this._x += npixels;
                           if (this._x >= 0) this._x = this._x - w;
                        // mouse over right half of slider:
                        } else if (_xmouse > mask_mc._x + hw && _xmouse < mask_mc._x + mask_mc._width) {
                           npixels = (_xmouse - hw) / hw * MAXPIXELS;
                           this._x -= npixels;
                           if (this._x <= -w) this._x = this._x + w;
                        }
                     }
                  }
                  
                  // thumbnail click (onrelease) handler
                  
                  function openPic() {
                          pic_mc.loadMovie(locVar[this.i]);
                  }
                  
                  function brightON(){
                       this._alpha = 300;
                  }
                  function brightOFF(){
                       this._alpha = 30;
                  }
                  function captionTXT(){
                       cap_txt.text = capVar[this.i];
                            
                  }
                  
                  // assign event handlers (called when all jpgs are loaded)
                  
                  function setupHandlers() {
                     pct_txt.removeTextField();          // don't need loading indicator any more
                     thumbs_mc.onEnterFrame = sliderControl;
                     for (var i:Number = 0; i < NPICS*2; i++) {
                          
                        thumbs_mc["mc"+i].onRollOver = brightON;
                        thumbs_mc["mc"+i].onRollOut = brightOFF;
                        thumbs_mc["mc"+i].onMouseDown = captionTXT;
                        thumbs_mc["mc"+i].onRelease = openPic;
                     }
                  }
                  
                  // listener function for broadcast 'done' message (for each pic)
                  // onLoadInit gets executed when the movieclip has been loaded into _mc AND 
                  //   its width and height data are available.
                  //   (_mc = the movieclip being loaded into)
                  // this routine sets the size and position of each thumbnail clip as its jpg
                  //   is loaded and starts the next one loading.  When all have been loaded, 
                  //   a random picture is loaded into pic_mc and setupHandlers is called to 
                  //   assign handlers to each thumbnail movieclip
                  
                  function onLoadInit(_mc:MovieClip) {
                     // this gets done when the jpg is completely loaded:
                     _mc._width = THUMBW;
                     _mc._height = THUMBH;
                     _mc._alpha = 30;          // for image clarity
                     // give the movieclip a property to remind it who it is
                     // (used by openPic to know which big picture to open)
                     _mc.i = (ipic >= NPICS ? ipic-NPICS : ipic);
                       
                     // add picture size to totalloaded variable
                     totalloaded += loader.getProgress(_mc).bytesTotal;
                  
                     // now load the next one (if there are more) or set up handlers if done
                     ipic++;
                     if (ipic == NPICS * 2) {
                        // start with a random photo displayed when all thumbs loaded
                         var calc:Number = Math.floor(Math.random()*NPICS);
                         
                        pic_mc.loadMovie(locVar[0]);
                         cap_txt.text = capVar[0];
                         
                        setupHandlers();
                     } else if (ipic >= NPICS) {
                        // load jpg into duplicate thumbnail (will already be cached)
                        loader.loadClip(tmbVar[ipic-NPICS],  thumbs_mc["mc"+ipic]);
                  
                     } else {
                        // load jpg into thumbnail
                        loader.loadClip(tmbVar[ipic],  thumbs_mc["mc"+ipic]);
                     }
                  }
                  
                  // listener function to handle broadcast progress messages
                  // make pct_txt show cumulative loading progress
                  
                  function onLoadProgress(_mc:MovieClip, loaded:Number) {
                     var loadedsofar:Number = totalloaded + loaded;     
                     pct_txt.text = Math.floor(loadedsofar / TOTALBYTES * 100) + "%";
                  }
                  
                  function init() {
                     // create holder for pictures
                     createEmptyMovieClip("pic_mc", 1);
                     pic_mc._x = PICX;
                     pic_mc._y = PICY;
                  
                     // create (and draw) holder for thumbnails 
                     createEmptyMovieClip("thumbs_mc", 2);
                     thumbs_mc.beginFill(0, 100);     // black
                     thumbs_mc.moveTo(0, 0);
                     thumbs_mc.lineTo(2 * (MARGIN + THUMBW) * NPICS, 0);
                     thumbs_mc.lineTo(2 * (MARGIN + THUMBW) * NPICS, THUMBH);
                     thumbs_mc.lineTo(0, THUMBH);
                     thumbs_mc.endFill();
                     // drawing the thumb holder at 0, 0 and then moving it makes its reg point = upper left
                     thumbs_mc._x = THUMBHOLDERX;
                     thumbs_mc._y = THUMBHOLDERY;
                  
                     // create, draw and enable mask over thumbs (could use different variables to define mask
                     // if desired)
                     createEmptyMovieClip("mask_mc", 3);
                     mask_mc.beginFill(0x0000cc, 100);
                     mask_mc.moveTo(0, 0);
                     mask_mc.lineTo(MASKW, 0);
                     mask_mc.lineTo(MASKW, MASKH);
                     mask_mc.lineTo(0, MASKH);
                     mask_mc.endFill();
                     mask_mc._x = MASKX;
                     mask_mc._y = MASKY;
                     thumbs_mc.setMask(mask_mc);
                  
                     // create loading textfield indicator
                     createTextField("pct_txt", 4, 200, 100, 40, 100);
                     var tf:TextFormat = new TextFormat();
                     tf.align = "center";
                     tf.size = 12;
                     tf.font = "Verdana";
                     tf.color = 0xFFFF00;
                     pct_txt.setNewTextFormat(tf);
                     
                     createEmptyMovieClip("caps_mc", 5);
                     caps_mc.beginFill(0x000000, 50);
                     caps_mc.moveTo(0, 0);
                     caps_mc.lineTo(CAPSW, 0);
                     caps_mc.lineTo(CAPSW, CAPSH);
                     caps_mc.lineTo(0, CAPSH);
                     caps_mc.endFill();
                     caps_mc._x = CAPSX;
                     caps_mc._y = CAPSY;
                     
                     // create loading textfield indicator
                     createTextField("cap_txt", 6, 38, 380, 525, 25);
                     var cf:TextFormat = new TextFormat();
                     cf.align = "center";
                     cf.size = 16;
                     cf.font = "Arial Black";
                     cf.color = 0xFFFFFF;
                     cap_txt.setNewTextFormat(cf);
                     cap_txt._x = CAPSX;
                     cap_txt._y = CAPSY;
                  
                     // make empty movieclips in thumbs_mc for each pic to go into
                     // make double the number so the slider can move continuously and show content
                     for (var i:Number = 0; i < NPICS * 2; i++) {
                        var mc:MovieClip = thumbs_mc.createEmptyMovieClip("mc"+i, i+1);
                        mc._x = i*(MARGIN + THUMBW);
                        mc._y = 0;
                     }
                       
                     // set the pointer to the first jpg in the array locVar
                     ipic = 0;
                     // start loading jpgs (ipic is initialized to 0)
                     loader.loadClip(locVar[ipic], thumbs_mc["mc"+ipic]);
                     cap_txt.text = capVar[2];
                  }
                  
                  init();
                  stop();
                  
                  • 6. Re: actionscript to load captions from array to dynamic text when thumb is clicked
                    Ned Murphy Adobe Community Professional & MVP

                    This will be a good time for you to become familiar with using the trace function.  It is one of the primary tools available for troublshooting code.  It lets you check the status of things as code is processed so that you can see what's what and what isn't.  Try inserting the following trace call in the function so that you can see what might be happening as far as the unchanging caption goes...

                     

                    function captionTXT(){

                         trace(this.i);
                         cap_txt.text = capVar[this.i];

                    }

                    1 person found this helpful
                    • 7. Re: actionscript to load captions from array to dynamic text when thumb is clicked
                      a@ve-creative Level 1

                      i've just been using trace to see exactly what happens with my loops and its results in displaying the correct amount of array values (which in my case for tests is 0-5) but doubles it up so it looks like 5,4,3,2,1,0,5,4,3,2,1,0

                      • 8. Re: actionscript to load captions from array to dynamic text when thumb is clicked
                        Ned Murphy Adobe Community Professional & MVP

                        I don't know what you are tracing where with what you just explained.

                        • 9. Re: actionscript to load captions from array to dynamic text when thumb is clicked
                          a@ve-creative Level 1

                          the code that calls the function is just below....i have attached a zip file with my fla....it's easier for you to see what th code does as i can't explain it all too well

                           

                          function setupHandlers() {
                             pct_txt.removeTextField();          // don't need loading indicator any more
                             thumbs_mc.onEnterFrame = sliderControl;
                             for (var i:Number = 0; i < NPICS*2; i++) {
                          
                                thumbs_mc["mc"+i].onRollOver = brightON;
                                thumbs_mc["mc"+i].onRollOut = brightOFF;
                                thumbs_mc["mc"+i].onMouseUp = captionTXT;
                                thumbs_mc["mc"+i].onRelease = openPic;
                             }
                          }
                          

                           

                          is use exactly what you said

                           

                          function captionTXT(){
                               trace(this.i);
                          }
                          

                           

                          and these are my results

                           

                          5
                          4
                          3
                          2
                          1
                          0
                          5
                          4
                          3
                          2
                          1
                          0
                          
                          • 10. Re: actionscript to load captions from array to dynamic text when thumb is clicked
                            Ned Murphy Adobe Community Professional & MVP

                            Since you say you are new to actionscript, how much of the code that your are displaying for this file did you create yourself?

                             

                            The problem with attaching zip files to these forums is that something corrupts them such that I cannot open them.  If you could make your file available via some other server I may have better luck, but only if it is a CS3 or earlier file.

                             

                            With that trace in place, and ignoring those ten bits of output that show up when you start, what do you see when you try clicking the images?

                            • 11. Re: actionscript to load captions from array to dynamic text when thumb is clicked
                              a@ve-creative Level 1

                              hi, i don't use anything other than CS3. here is the link http://ve-creative.com/gallery.zip

                               

                              it was from a tutorial.....the main bulk of it was coding from the tutorial but i changed it to shorten it down and because i didn't like how it had the arrays and used them through out. As it is important and for a large project i've not had time to learn from scratch like i would normally do.

                               

                              when i click on the images the larger image appears.....the captions either don't do anything or depending if i have a loop there it will just skip straight to the last caption and not do anything afterwards.

                               

                              once clicked it also traces 5,4,3,2,1,0,5,4,3,2,1,0

                              • 12. Re: actionscript to load captions from array to dynamic text when thumb is clicked
                                Ned Murphy Adobe Community Professional & MVP

                                You appear to be taking the opposite approach than what you should... if this is an important and large project, you are much safer knowing all you can about what you are designing.  Designing it from scratch would probably be easier for you to understand and get working.  This isn't intended to be a sarcastic or meanly intended response... I'm not getting paid too figure out how to revise what you have already revised into who knows what condition, but you probably are.  Based on what that trace is producing, you may have quite a bit of work ahead of you to see why it is doing that.

                                 

                                You may need to rethink the process of how you go about having the text appear.  When you are loading the large images into movieclips, maybe you should also add the textfield into those same movieclips and assign the text to them at that stage.  That way, the thumbs aren't involved with displaying the text at all.  It's what I'd probably do.

                                 

                                Alternately, I would have approached this design using AS3, which makes what you are currently trying to do easier to manage.  But that's a whole 'nother learning curve.

                                1 person found this helpful
                                • 13. Re: actionscript to load captions from array to dynamic text when thumb is clicked
                                  a@ve-creative Level 1

                                  i have never asked for you to revise it....it asked to be shown where i have gone wrong......

                                   

                                  can you point me in the direction of how to assign text fields to clips that have been dynamically created? and i will take it from there

                                   

                                  thanks for the help

                                  • 14. Re: actionscript to load captions from array to dynamic text when thumb is clicked
                                    Ned Murphy Adobe Community Professional & MVP

                                    If you look up the MovieClip.createTextField method in the Flash help documents, it will demonstrate how to assign a textfield to a movieclip.