XML to load images dynamically

Hi,
I have an XML file which is programmed to load images into a slide show dynamically. So it must be associated with a button to launch this I'd imagine.
If I want to add more buttons, do I simply add more script to that one XML file giving the new images different names than what was used with button #1, or do I create an XML file for each button and upload all to the web?
Thanks.

xml files can't program anything.  they store data (and are there a from of database).
it's not clear what adding more buttons has to do with your xml file.   is there data in the xml file that relates to buttons?
and it's not clear what images and a slide show have to do with anything.
but commonly, an xml file would store data about what images to display in a slideshow.  and the xml file might even contain text to display for each image and possibly an external link associated with each image and maybe some specifics about how to display the image.

Similar Messages

  • Load image dynamically by scripting to dynamic xml pdf, is it possible?

    Hi All,
    I've uploaded static pdf form to http://groups.google.com/group/livecycle/web/logo.pdf.
    The form contains ImageField.
    In the "docReady" event of the form I wrote a script:
    ImageField1.value.image.href="http://www.quicksoft.co.il/images/
    quicksoftlogo2.jpg";
    When the form is loaded the ImageField shows the image from the url
    I've updated in the script.
    Once the form is saved as dynamic xml pdf the script stop working.
    Is that means that it is not possible to load images by scripting to
    dynamic xml pdfs?
    Anyone familiar with workarounds for it?
    Thanks in advance,
    Rbuz

    I got an answer from Adobe:
    Dynamic change of an image href has been disabled due to potential security issues. There are however a few workarounds to choose from:
    1. Embedding the images in the form as hidden objects. They can then be set to visible on initialize or clicking a button. This will affect performance, but if the images are in a compressed format, this can be minimized.
    2. Create a Web service interface to grab the image from wherever they are stored, base64 encode it and return it to the form. You would also have to update the bindings for the image field on the form (a one time operation).

  • Problems loading images dynamically with XML

    Hi Everyone,
    I am working with a project that was build by another
    developer and I have been asked to modify it several ways. This is
    an interactive map for a hotel brand where when you click on the
    USA, you get a list of all the states, click a state and a list of
    all the hotels in that state comes up, click a hotel, the hotel's
    information is displayed. I understand the structure of the files,
    how they make them work, though I couldn't build it myself.
    The problem I am having is this. can't make the hotels'
    photos load into the flash through the XML. I created a target
    movie file that the image could load into but something is not
    happening as far as loading the images. I don't know if the movie
    clip that I created is the right way to go (it was made as an
    object in the library that is exported via AS), or if I should
    create one in the action script file that loads the XML data.
    I looked at some tutorials about how to load images with XML
    but those didn't get into the level of detail that I need for this
    project.
    I've attached some partial code to see if anyone can help me
    work through this.
    Any and all suggestions are welcome.
    Thanks for the help in advance.
    Jeremiah

    I'm a noob at AS3 and trying to learn this XML stuff myself,
    but i have been able to load pictures to the stage...this might
    help you...my xml file photo section is similar to yours, only I
    have it labeled as "href" instead of "source"...
    var imageLoader:Loader;
    var xml:XML;
    var xmlList:XMLList;
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.load(new URLRequest("xmldata/images.xml"));
    xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
    function xmlLoaded(event:Event) :void {
    xml = XML(event.target.data);
    xmlList = xml.children();
    for (var i:int = 0; i<xmlList.length(); i++) {
    imageLoader = new Loader();
    imageLoader.load(new URLRequest(xmlList
    .attribute("href")));
    imageLoader.x = 0;
    imageLoader.y = 0;
    addChild(imageLoader);

  • Problem with loading images dynamically in a pdf document

    dear,
         I am using live cycle designer and i need to load image from a url dynamically in to the document.For this case i placed an imagefield on my document and i wrote javascript to load image in the form:ready event.
    My script for that was
    imagefield.value.image.href="url".Actually i saw an imagefield in my document but it doesnt carry any image.Please help me to rectify this problem......

    If you save your form as Static PDF, it works.
    But most of the time we need the Dynamic XML form. So, I am also stuggling with this issue.
    Nith

  • Loading Images Dynamically from MySql

    Hello
    I need to load images in my swf file dynamically from MySql
    using PHP. Brief is I have one Swf file and and i want to animate
    image in it but image should be come from dynamic path.. anybody
    can tell me how to do this? if you want more brief then i can
    provide it but it is urgent...
    Thanks in advance

    I'm afriad I don't have a solution to your problem but I was
    curious as to why you would load it from a database vs a directory.
    I know you can have users upload to a directory and a database but
    I don't understand the benifit since I think you'd be adding load
    on the database server. Is it a server side image manipulation
    thing?

  • Loading images dynamically

    Hi,
    This is my code.
    [Embed(source="C:/images/temp.jpg")]
    var uploadedImage:String;
    imgPhoto.source = uploadedImage;
    Every time the image changes, I need to dynamically load the new image. But flex seems to cache the image somewhere.
    I cannot get the new image to display. Any suggestions. Thank You.

    For your kind information flex doesnt cache any image. use Bindable as follows
                [Embed(source="image")]
                [Bindable] -- Important
                public var Logo:Class;           
            ]]>
        </mx:Script>
    When the source changes image also changes
    image.source = Class;
    good to go....

  • Sandbox error, crossdomain loading Images dynamically

    Hi!
    I have a following image:
    <mx:Image id="listakuva1"
    source="images/autoListasivu.jpg"
    complete="handleImageComplete(event)" />
    And because I have to scroll the image, I have to turn the
    smoothing on when complete:
    private function handleImageComplete(event: Event): void {
    var bitmap: Bitmap = ((event.target as Image).content as
    Bitmap);
    if (bitmap != null) {
    bitmap.smoothing = true;
    This works fine. But then I want to change the image when
    user does something:
    listakuva1.load("new image in another domain via URL");
    And it gives me security sandbox error. I googled and I found
    that I should put:
    checkPolicyFile = true;
    to somewhere but I can't figure out WHERE!
    The images are still loaded without the warning but the
    smoothing-function is not working.
    PLS Help.
    BR Timo

    Hi,
    It would be great if you can post a simple sample. I can try
    it out on a Mac and let you know.

  • XML to load images

    Is it possible to have XML pull images into into a
    gallery?

    HI,
    it is very much possible to pull images into the gallery with
    XML. It is the
    same XML parsing which is used for Flash Player. There is
    another way to
    pull images without XML by startegically naming your image
    files..
    ..Debashish
    "frexx" <[email protected]> wrote in message
    news:e0rpfr$e7n$[email protected]..
    > Is it possible to have XML pull images into into a
    gallery?

  • Scaling images dynamically

    i'm loading images dynamically. The images that will be
    uploaded will very rarely be of the exact same dimensions, so
    scaling percent wise doesn't exactly do what I want. I would like
    to scale an image up and down to a precise amount of pixels (say,
    116(width)*86(height)).

    once the image is loaded completely (onLoadInit Event must be
    fired if using MovieClipLoader) you can access the size of the
    image via the _width and _height properties.
    The logic to code would be to check the size of the image and
    check if it fits into a virtual bounding box that marks the max
    width and height for the images as they should be dispayed.
    If one (or both) sides of the image exceeds the maximum
    width, calculate the percentage by which you must scale the image
    down to fit this sied into the "box". Apply this factor to BOTH the
    widht and the height, then check if the other side of the image is
    still to big to fit into the box and repeat the downscaling if
    needed.

  • Dynamically loaded images cached?

    We have an xml feed that is refreshed every hour. According
    to the xml file, we dynamically load an image into an html text
    field each time someone hits our page. All of the images have been
    recently updated, but the old ones are still appearing? We use the
    swf?nocache=randomnumber convention to make sure the swf file
    itself isn't cached, but is there anything we can do to clear out
    the cache of dynamically loaded images? If there isn't anything we
    can do, will these all eventually refresh themselves? This is how
    the html is generated where "twcImage[0]" is the image in question.
    Thanks!

    Do the same random number for the images.
    twcImage[0] + randomnumber
    Dan Smith > adobe community expert
    Flash Helps >
    http://www.smithmediafusion.com/blog/?cat=11
    http://www.dsmith.tv
    "Wolli World" <[email protected]> wrote in
    message
    news:fvvcrc$k9o$[email protected]..
    > We have an xml feed that is refreshed every hour.
    According to the xml
    > file,
    > we dynamically load an image into an html text field
    each time someone
    > hits our
    > page. All of the images have been recently updated, but
    the old ones are
    > still
    > appearing? We use the swf?nocache=randomnumber
    convention to make sure
    > the swf
    > file itself isn't cached, but is there anything we can
    do to clear out the
    > cache of dynamically loaded images? If there isn't
    anything we can do,
    > will
    > these all eventually refresh themselves? This is how the
    html is
    > generated
    > where "twcImage[0]" is the image in question. Thanks!
    >
    > twcTarget.text = "<img align='left' hspace='5'
    vspace='0' src='
    http://" +
    > _root.server + "/rss/weather/images/" +
    > twcImage[0] + "'>" + "<condition>" + ... and so
    on
    >

  • Loading images from an Array generated from XML

    OK, this is my first day trying to use AS3 and I'm kind of
    confused on how to load an image onto the screen and then be able
    to resize it, scale it, etc..
    I'm loading up to 5 images in from an XML file that will be
    generated on a server. (right now I'm just using a test.xml file).
    Normally I would load the images into dynamically created
    movie clips (whatever0_mc through whatever4_mc generated by code in
    AS2). But I can't seem to get anything working.. I've looked on the
    internet and read through some information but I'm still just
    REALLY confused... this is what I have so far. To make it easier on
    me in the future, I've put different code on different layers so I
    can look at it closer.. I've separated the code into the different
    layers they're on here:
    First Layer:
    import flash.events.Event;
    import flash.net.URLLoader; // URL Loader Import for Images
    import flash.net.URLRequest; // URL Requests Import for
    Images
    import flash.display.Loader; // Loader
    import flash.events.ProgressEvent; // Progress for Loader
    import flash.text.TextField; // Imports for Text Fields
    import flash.display.Sprite; // Imports Sprite stuff for
    loaded Images
    import flash.display.Bitmap; // Imports stuff to display a
    bitmap
    Second Layer:
    var imgLoader:Loader = new Loader(); // Initialize Image
    Loader
    // Listeners for the Image Loaders //
    function showPreloader(evt:Event):void {
    trace("-- ** showPreloader ** --");
    addChild(loadProgress_txt);
    function showProgress(evt:ProgressEvent):void {
    trace("-- ** showProgress ** --");
    var totalLoaded:Number = evt.bytesTotal;
    var currentLoaded:Number = evt.bytesLoaded;
    var thePercent:Number = (currentLoaded * 100) / totalLoaded;
    loadProgress_txt.text = thePercent + "%"; // Show bytes
    loaded
    function showLoadResult(evt:Event):void {
    trace("-- ** showLoadResult ** --");
    Third Layer:
    // Setup Variables //
    var imageArray:Array = new Array();
    var galleryTitle:String;
    var numPhotos:Number;
    var gallerySubmitter:String;
    // XML Info //
    XML.ignoreComments = true;
    XML.ignoreWhitespace = true;
    var galleryXML:XML;
    var xmlLoader:URLLoader = new URLLoader();
    var request:URLRequest = new URLRequest("test.xml");
    xmlLoader.load(request);
    xmlLoader.addEventListener(Event.COMPLETE, XMLComplete);
    function XMLComplete(evt:Event):void {
    trace("-- ** XMLComplete ** --");
    var loader:URLLoader = evt.target as URLLoader;
    if (loader != null){
    galleryXML = new XML(loader.data);
    galleryTitle = galleryXML.children()[0].attributes()[0];
    numPhotos = galleryXML.children()[0].attributes()[1];
    gallerySubmitter = galleryXML.children()[0].attributes()[2];
    trace("galleryTitle: " + galleryTitle);
    trace("numPhotos: " + numPhotos);
    trace("gallerySubmitter: " + gallerySubmitter);
    for(var i:Number = 0; i<numPhotos; i++) {
    imageArray.push(galleryXML.children()[0].children()
    .attributes()[1]);
    } // for(var i:Number = 0; i<numPhotos; i++)
    trace(imageArray.toString());
    trace("loading: images\\gallery\\" + imageArray[0]);
    var imgRequest:URLRequest = new
    URLRequest("images\\gallery\\" + imageArray[0]); // Request the
    Image into the Loader
    imgLoader.load(imgRequest);
    imgLoader.contentLoaderInfo.addEventListener(Event.OPEN,showPreloader);
    imgLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,showProgress);
    imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,showLoadResult);
    } else { // if (loader != null){
    trace("loader is not a URLLoader!");
    } // if (loader != null){
    } // function onComplete(event:Event):void {
    // End XML Info //
    Can anyone point me in the next direction?
    thanks...

    When you used the IMAQ create VI you specified each image to use the same name of "image".  Each image has to have a unique name.  I edited your VI to give a unique name for each image and I was able to view three different images in three different viewing panes.
    Attachments:
    Image Array Reworked.vi ‏19 KB

  • Swapping xml loaded Images to scene elements?

    Hi there!
    I have a small quick question about xml loaded images.
    Can you append/attach/swap the images to elements in your scene?
    I would like to manually animate a movieclip using keyframes and motion tweens. For example, to have a movieclip FLY! accross the screen! lol But I want the image on it to be of one that has been dynamically loaded.
    I can't seem to work out how to replace an image on a movieclip from a dynamically loaded image.
    Is it even possible?
    Thanks heaps for your time you guys!

    If the original image is the only object within the movieclip, you can use removeChildAt(0) to get rid of it, and use addChild(your_new_image) to replace it.

  • How to load images using xml in flash

    Hi
    im working on a quiz project where i plan to load images using xml in to flash, can any one help with the script with AS2 or 3

    You'll find a tutorial for what you are after here:
    http://www.gotoandlearn.com/play?id=22

  • Load multiple parts of an XML file into one dynamic Text Field

    Hi I am trying to load text from an external XML file into a dynamic text box. I have so far managed to load single parts of the XML file into a dynamic text field. I now want to be able to load different parts of the XML file (something similar to a string with appendText) into the same text Field.
    I have so far managed to achive this using the String and append text properties, but would like to use XML file to do it instead.
    Any tips please?
    Thanks

    In essence you can just do:
    TextField.text = XML.node1 + XML.node2;

  • XML scrolling thumbnail, image loader, & Buttons [halfway works]

    Intro:
    I started a flash-based website a few years ago. Back in 2006 I was able to get a xml scrolling thumbnail, image loader to work without a glitch.
    For numerous reasons I had to put the project on hold until now. [one was that my 30 day trial of flash expired and only recently was I able to purchase the Adobe Web Suite CS4 as well as a new computer which could run the apps.]
    Last Friday saw a bump in the road in the development of my site as two, rather straightforward task, turned into something short of a nightmare as I have been unable to get past these two, seemingly, relatively simple task.
    I have posted in 4 other flash forums the issues, in detail, that I am facing - and have quite a bit of interest/views in the topic as the numbers suggest - yet no response/answer as of yet. [Which confirms other messages I have seen which seem to state that working with buttons has become increasingly difficult with the newer version of flash - something Im a bit surprised with actually from Adobe. - I would have thought there would be a palette where you could set parameters...]
    Screenshot of Site/Timeline:
    Before getting into the two questions I have, I would like to post an image of the site as it looks whenever an swf file is saved out, as well as a piece of the timeline in the back for reference.
    Issue #1
    As of now when the swf file is saved out you get exactly what you see above:
    a: A scrolling thumbnail
    b: ...which loads a large image when clicked on it - PEFECT...
    BUT...
    1a: I need for the buttons to load in this action, not for it to just load on its own.
    [i.e., the silk_paintings gallery is what is open, so I need the "silk_paintings" button to call up this action]
    note: Initially I had attacked this problem by taking out the actions layer you see above and applying it directly to the individual buttons with some crude MouseEvent Listener/Handerls... that did not work - at all.
    Im sure it may be "easier" to make an array out of it, but with my coding level it may be "easier" to apply it to the buttons.
    1b: How I currently see it, I would take the xml-list and duplicate it for the number of galleries I have.
    [I would then re-name the xml-list to reflect the name of the galleries they are to represent, i.e. "silk_paintings"]
    [also, I would have to rename the folders to "thumbnails1,2,3, etc., & "images 1,2,3, etc"
    From there I would duplicate the actions and paste it into the buttons, changing the xml-list name to that of "silk_paintings", etc., as well as write in the MouseEvent listener Handler to make it work. [ah, ha, but what is that magic phrase, I have tried to implement various code from other tutorials, and all in vein.]
    Issue #2
    At this point I would be tickled pink just to get this to basic function to work.
    However, once the buttons are working and calling up the xml, etc., then I need the buttons to stay on the semi-transparent blue color it is whenever in the 'hit' state. [note: NOT pictured above.]
    With the way the buttons are currently set up, and with wanting to use scripting to get them to interact with the thumbnail gallery, it will have to be some miraculous code to tell that button what color to stay as whenever its clicked, and of course it going back to white when another button is clicked.
    Conclusion:
    Since this is an Adobe Forum I would like to make a few additional statements in hopes that the developers, etc. may take heed.
    Adobes products are not cheap, and when I went to purchase the websuite I went in as a designer needing a program as not to need to program.
    I understand the flexibility that coding gives, but something as simple as linking buttons should not be in the realms of rocket science. [yes, for many its not...but my brain just does not operate that route despite all the tutorials thrown at me.]
    Again, it would seem that there would be a button panel where you could drag options like scrolling thumbnail slider, loader, and then parameters would come up. [much like Apples iWeb. - but before the argument of one being pro and the other for non-pros, I see it differently. Software should not be the limiting factor in how flexible you can design, or rather ones lack of programming shouldnt be. With all the talented, and I say this in all humility and honesty, programmers working for Adobe, Im sure something could be programmed like what Im asking for.]
    note: Director is a good example, back in 1997 I knew nothing of multimedia and in one week I had assembled a portfolio, clicking buttons, speech, movies, and all. - and no, I dont have the money to buy more software!
    At this moment I am at the mercy of someone who reads code like its a nighttime tale they are telling their kids, and who can see the exact issue I have and can share the appropriate, correct code. [as I have noticed, it has to be on target - naturally - but this target changes with just a slight change in the design.]
    Thank you,
    peace
    Dalen
    p.s.
    The actionscript: [note: This is only the current working/good code that Im trying to get the buttons to call up.]
    stop();
    fscommand("allowscale", false);//keep SWF display at 100%
    var x:XML = new XML ();//Define XML Object
    x.ignoreWhite = true;
    var fullURL:Array = new Array;//Array of full size image urls
    var thumbURL:Array = new Array;//Array of thumbnail urls
    var thumbX:Number = 25;//Initial offset of _x for first thumbnail
    x.onLoad = function(){ //Function runs after XML is loaded
        var photos:Array = this.firstChild.childNodes;//Defines variable for length of XML file
         for (i=0;i<photos.length;i++) {//For loop to step through all entry lines of XML file
              fullURL.push(photos[i].attributes.urls);//Each loop, adds URL for full sized image to Array fullURL
              thumbURL.push(photos[i].attributes.thumbs);//Each loop, adds URL for thumbnails to Array thumbURL
              trace(i+". Full Image = "+fullURL[i]+"  Thumb Image = "+thumbURL[i]);         
              var t = panel.attachMovie("b","b"+i,i);//Each loop, Define local variable 't' as a new instance of 'b' movie clip, given unique instance name of 'b' plus the index number of the For loop
              t.img.loadMovie(thumbURL[i]);// Each loop, load thumbnail image from XML data into variable movie clip
              t._y = 0;//Set Y coordinate of variable movie clip
              t._x = thumbX;//Set X coordinate of variable movie clip based on variable thumbX
              t.numb = i;//Set sub-variable 'numb' inside variable t to hold index number
              t._alpha = 75;//Set the Alpha value of the variable movie clip to 75% - for onRollOver highlight action
              thumbX += 55;//Increment thumbX value so next thumbnail is placed 125 pixels to the right of the one before
              t.onRollOver = function () {//define onRollOver event of the variable movie clip
                   this._alpha = 100;//Set thumbnail alpha to 100% for highlight
              t.onRollOut = function () {//define onRollOut event of the variable movie clip
                   this._alpha = 75;//Reset thumbnail alpha to 75%
              t.onPress = function () {//define onPress event of the variable movie clip
                   this._rotation += 3;//rotates thumbnail 3 degrees to indicate it's been pressed
                   this._x += 3;//Offset X coordinate by 3 pixels to keep clip centered during rotation
                   this._y -= 3;//Offset Y coordinate by 3 pixels to keep clip centered during rotation
              t.onReleaseOutside = function () {//define onRelease event of the variable movie clip
                   this._rotation -= 3;//rotate thumbnail back 3 degrees
                   this._x -= 3;//Reset X coordinate by 3 pixels to keep clip centered during rotation
                   this._y += 3;//Reset Y coordinate by 3 pixels to keep clip centered during rotation
                   this._alpha = 75;//Reset thumbnail alpha to 75%
              t.onRelease  = function () {//define onRelease function to load full sized image
                   this._rotation -= 3;//rotate thumbnail back 3 degrees
                   this._x -= 3;//Reset X coordinate by 3 pixels to keep clip centered during
                   this._y += 3;//Reset Y coordinate by 3 pixels to keep clip centered during
                   this._alpha = 75;//Reset thumbnail alpha to 75%
                   holder.loadMovie(fullURL[this.numb]);//Load full sized image into holder clip based on sub-variable t.numb, referenced by 'this'
         holder.loadMovie(fullURL[0]);//Initially load first full size image into holder clip
    x.load ("silk_paintings.xml");// path to XML file
    panel.onRollOver = panelOver;
    function panelOver() {
         this.onEnterFrame = scrollPanel;
         delete this.onRollOver;
    var b = stroke.getBounds(_root);
    function scrollPanel() {
         if (_xmouse<b.xMin||_xmouse>b.xMax||_ymouse<b.yMin||_ymouse>b.yMax) {
         this.onRollOver = panelOver;
         delete this.onEnterFrame;
         if (panel._x >= 740) {
         panel._x = 740;
    if(panel._x <= (thumbX-10))  {
              panel._x = (thumbX-10)
         var xdist = _xmouse - 830;
         panel._x += -xdist / 7;
    The xml:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <slideshow>
    <photo thumbs="thumbnails/i_brown_fairy.jpg"  urls="images/brown_fairy.jpg"  />
    <photo thumbs="thumbnails/i_blonde_fairy.jpg"  urls="images/blonde_fairy.jpg"  />
    <photo thumbs="thumbnails/i_flower_fairy.jpg"  urls="images/flower_fairy.jpg"  />
    <photo thumbs="thumbnails/i_red_fairy.jpg"  urls="images/red-fairy.jpg"  />
    </slideshow>
    Attached is a link to the file I made named "index".
    https://rcpt.yousendit.com/706233226/5e7b4fe0973dacf090b5cbae32c47398
    I would have liked to have included the following files but was limited due to "you-send-it" not uploading folders.  Files not included: [but functioning] : xml list - images [folder] - thumbnails [folder]
    Again, Thank you
    Dalen

    The issues with the buttons calling up the scrolling thumbnail panel have been resolved, as well as keeping the buttons in their hit state once clicked, thanks to Rob.
    Those that have been following this thread, or stumble upon it in their searches later, may appreciate to see the final solution to this particular issue.
    [Hopefully I will be able to update this thread with a url in the future to show the site in operation, which may help somebody with their project in the future if its set up similarly.]
    Alas, it would be nice if future versions of flash had a more direct, flexible, user friendly method for creating navigation.
    [We may see development beyond the flash ads which everyone seems to loathe... and more creativity with flash in terms of games, web interactivity, &  animation.
    Below are 2 sets of code:
    a] the first is located within the first frame of the first button, and has some extra variables in it that the additional buttons call upon...
    b] the second is the code applied to every other button.
    stop();
    fscommand("allowscale", false);//keep SWF display at 100%
    var x:XML = new XML();//Define XML Object
    x.ignoreWhite = true;
    var fullURL:Array = new Array();//Array of full size image urls
    var thumbURL:Array = new Array();//Array of thumbnail urls
    //  .......  CHANGE
    var thumbX:Number;// = 25;//Initial offset of _x for first thumbnail
    // make an array of all of the instance names of each button object...
    // only do this once
    var buttonsList:Array = new Array(shadesOfGrey, silkPaintings);
    shadesOfGrey.isLatched = false;
    // the rollover function... repeat for each button
    shadesOfGrey.onRollOver = shadesOfGrey.onDragOver=function ():Void {
         if (!this.isLatched) {
              this.gotoAndStop(2);
    // the rolloff function... repeat for each button
    shadesOfGrey.onRollOut = shadesOfGrey.onDragOut=shadesOfGrey.onReleaseOutside=function ():Void {
         if (!this.isLatched) {
              this.gotoAndStop(1);
    // the mouse press function... repeat for each button
    shadesOfGrey.onPress = function():Void  {
         resetAllButtons();
         this.isLatched = true;
         this.gotoAndStop(3);
    shadesOfGrey.onRelease = function():Void  {
         x.load("shadesOfGrey.xml");// path to XML file
         thumbX = 25;
    function resetAllButtons():Void {
         for (b in buttonsList) {
              buttonsList[b].isLatched = false;
              buttonsList[b].gotoAndStop(1);
    x.onLoad = function() {//Function runs after XML is loaded
         //  resets the position of the panel on each new load
         panel._x = 740;
         //  .......  CHANGE  removes the existing movieclips from the panel before any new load...
         for (c in panel) {
              if (typeof (panel[c]) == "movieclip") {
                   removeMovieClip(panel[c]);
         var photos:Array = this.firstChild.childNodes;//Defines variable for length of XML file
         for (i=0; i<photos.length; i++) {//For loop to step through all entry lines of XML file
              fullURL.push(photos[i].attributes.urls);//Each loop, adds URL for full sized image to Array fullURL
              thumbURL.push(photos[i].attributes.thumbs);//Each loop, adds URL for thumbnails to Array thumbURL
              //trace(i+". Full Image = "+fullURL[i]+"  Thumb Image = "+thumbURL[i]);
              var t = panel.attachMovie("b", "b"+i, i);//Each loop, Define local variable 't' as a new instance of 'b' movie clip, given unique instance name of 'b' plus the index number of the For loop
              t.img.loadMovie(thumbURL[i]);// Each loop, load thumbnail image from XML data into variable movie clip
              t._y = 0;//Set Y coordinate of variable movie clip
              t._x = thumbX;//Set X coordinate of variable movie clip based on variable thumbX
              t.numb = i;//Set sub-variable 'numb' inside variable t to hold index number
              t._alpha = 75;//Set the Alpha value of the variable movie clip to 75% - for onRollOver highlight action
              thumbX += 55;//Increment thumbX value so next thumbnail is placed 125 pixels to the right of the one before
              t.onRollOver = function() {//define onRollOver event of the variable movie clip
                   this._alpha = 100;//Set thumbnail alpha to 100% for highlight
              t.onRollOut = function() {//define onRollOut event of the variable movie clip
                   this._alpha = 75;//Reset thumbnail alpha to 75%
              t.onPress = function() {//define onPress event of the variable movie clip
                   this._rotation += 3;//rotates thumbnail 3 degrees to indicate it's been pressed
                   this._x += 3;//Offset X coordinate by 3 pixels to keep clip centered during rotation
                   this._y -= 3;//Offset Y coordinate by 3 pixels to keep clip centered during rotation
              t.onReleaseOutside = function() {//define onRelease event of the variable movie clip
                   this._rotation -= 3;//rotate thumbnail back 3 degrees
                   this._x -= 3;//Reset X coordinate by 3 pixels to keep clip centered during rotation
                   this._y += 3;//Reset Y coordinate by 3 pixels to keep clip centered during rotation
                   this._alpha = 75;//Reset thumbnail alpha to 75%
              t.onRelease = function() {//define onRelease function to load full sized image
                   this._rotation -= 3;//rotate thumbnail back 3 degrees
                   this._x -= 3;//Reset X coordinate by 3 pixels to keep clip centered during
                   this._y += 3;//Reset Y coordinate by 3 pixels to keep clip centered during
                   this._alpha = 75;//Reset thumbnail alpha to 75%
                   holder.loadMovie(fullURL[this.numb]);//Load full sized image into holder clip based on sub-variable t.numb, referenced by 'this'
         holder.loadMovie(fullURL[0]);//Initially load first full size image into holder clip
    // this one function scrolls the panel for all of the buttons, it gets the
    // size of the panel when the images are loaded by any given button...
    stroke.onEnterFrame = function() {
         if (this.hitTest(_xmouse, _ymouse, false)) {
              if (panel._x>=740) {
                   panel._x = 740;
              if (panel._x<=740-panel._width+mask._width) {
                   panel._x = 740-panel._width+mask._width;
              if ((panel._x<=740) && (panel._x>=740-panel._width+mask._width)) {
                   var xdist = _xmouse-830;
                   panel._x += -xdist/7;
    Of note is the change to how the movie clips are measured... this change in and of itself has really helped to make the thumbnail panels operation more efficient.
    Below is the script for each additional button: [Having issues with the forums not letting me post additional code, so I will put the remaining code in a reply below.]
    cont.

Maybe you are looking for