8 Replies Latest reply: Nov 27, 2012 1:49 PM by kkoepsel RSS

    Best tool for xml-driven client-controlled slideshow for non-Flash developers?

    sakonnetweb Community Member

      Greetings

       

      I have been using a very simple open-source tool for years that one can simply add any images in an xml file, open the pre-designed fla file, change the size to whatever you need, export the swf movie and you have an embedable  slideshow.

       

      I am looking for something a little more sophisticated- but only so that the slideshow does not advance except when client/user manually advances it, so it would need forward and back controls only.

       

      I apologize in advance if this topic has been discussed and answered in this forum, but I tried a search with no results.

       

      Been fooling around with Flash since it's early inception, but don't beleive in reinventing the wheel.

       

      Any help would be appreciated-

        • 1. Re: Best tool for xml-driven client-controlled slideshow for non-Flash developers?
          Ned Murphy CommunityMVP

          There are numerous ways to design a slideshow.  How you might implement the controls you want will depend on how yours is designed.  Try to find the code in the file that advances the slideshow and then see how to isolate that code into button functions.

          • 2. Re: Best tool for xml-driven client-controlled slideshow for non-Flash developers?
            sakonnetweb Community Member

            Hi- thanks for your quick response.

             

            I wish it were that easy- but if I am looking into code to add user controls, am I looking in the javascript in AC_RunActiveContent.js, the XML page:

             

            <!-- 
            'timer' :: number of seconds between each image transition
            'order' :: how you want your images displayed. choose either 'sequential' or 'random'
            'looping' :: if the slide show is in sequential mode, this stops the show at the last image (use 'yes' for looping, 'no' for not)
            'fadeTime' :: velocity of image crossfade. Increment for faster fades, decrement for slower. Approximately equal to seconds.
            'xpos' :: _x position of all loaded clips (0 is default)
            'ypos' :: _y position of all loaded clips (0 is default)
            -->
            <gallery timer="4" order="sequential" fadetime="3" looping="yes" xpos="0" ypos="0">

            <image path="slideshow/500_01.jpg" />
            <image path="slideshow/500_02.jpg" />
            <image path="slideshow/500_03.jpg" />
            <image path="slideshow/500_04.jpg" />
            <image path="slideshow/500_05.jpg" />
            <image path="slideshow/500_06.jpg" />
            <image path="slideshow/500_07.jpg" />
            </gallery>

             

            or while I have the FLA movie open in Flash?

             

            Thanks again....

            • 3. Re: Best tool for xml-driven client-controlled slideshow for non-Flash developers?
              Ned Murphy CommunityMVP

              In the Flash fla file.  That is where the code and controls will need to go.

              • 4. Re: Best tool for xml-driven client-controlled slideshow for non-Flash developers?
                sakonnetweb Community Member

                I hate to be pestiferous, but here's screen shot of the fla file - (slideshow_as2.fla) - not much to it - where can I go to see the code/add user controls?

                 

                Thanks......ss_fla.jpg

                • 5. Re: Best tool for xml-driven client-controlled slideshow for non-Flash developers?
                  Ned Murphy CommunityMVP

                  If there's nothing on the stage, and only one empty movieclip in the library, then your work of finding the code might be easier for you.  To find code you need to hunt for it.

                   

                  The first places to look are the obvious ones... and they are obvious because they show lowercase "a"s in the timeline.  Just open your Actions panel and then select that timeline frame that has the little "a" in it.

                   

                  The other place to find code would attached to objects. But since you don't seem to have anything on the stage, chances are there isn't any... unless that one empty movieclip in the library isn't actually an empty movieclip.

                   

                  But I have a feeling all the code you might need to find is borne by that little "a".

                  • 6. Re: Best tool for xml-driven client-controlled slideshow for non-Flash developers?
                    sakonnetweb Community Member
                    Re: Best tool for xml-driven client-controlled slideshow for non-Flash developers?

                    No little "a"s

                     

                     

                    This is the whole deal:

                     

                    /****************************/
                    /* Crossfading slide show   */
                    /* Author: Todd Dominey     */
                    /* http://whatdoiknow.org   */
                    /* http://domineydesign.com */
                    /****************************/

                     

                    // set random # variables - each must be 0 for first 'while' loop below
                    var randomNum = 0;
                    var randomNumLast = 0;

                     

                    // parent container
                    var container_mc = this.createEmptyMovieClip("container",0);
                    // movie clip containers
                    container_mc.createEmptyMovieClip("loader1_mc",2);
                    container_mc.createEmptyMovieClip("loader2_mc",1);

                     

                    // preload watcher
                    this.createEmptyMovieClip("watcher_mc",100);

                     

                    // load xml
                    images_xml = new XML();
                    images_xml.ignoreWhite=true;
                    images_xml.onLoad = parse;
                    images_xml.load("images.xml");

                     

                    function parse(success) {
                        if (success) {
                            imageArray = new Array();
                            var root = this.firstChild;
                            _global.numPause = Number(this.firstChild.attributes.timer * 1000);
                            _global.order = this.firstChild.attributes.order;
                            _global.looping = this.firstChild.attributes.looping;
                            _global.fadetime = Number(this.firstChild.attributes.fadetime);
                            _global.xpos = Number(this.firstChild.attributes.xpos);
                            _global.ypos = Number(this.firstChild.attributes.ypos);
                            var imageNode = root.lastChild;
                            var s=0;
                            while (imageNode.nodeName != null) {
                                imageData = new Object;
                                imageData.path = imageNode.attributes.path;
                                imageArray[s]=imageData;
                                imageNode = imageNode.previousSibling;
                                s++;
                            }
                            // place parent container
                            container_mc._x = _global.xpos;
                            container_mc._y = _global.ypos;
                            // parse array
                            imageArray.reverse();
                            imageGen(imageArray);
                        } else {
                            trace('problem');
                        }
                    }

                     

                    // depth swapping
                    function swapPlace(clip,num) {
                        eval(clip).swapDepths(eval("container_mc.loader"+num+"_mc"));
                    }

                     

                    function loadImages(data,num) {
                        if (i==undefined || i == 2) {
                            i=2;
                            createLoader(i,data,num);
                            i=1;
                        } else if (i==1) {
                            createLoader(i,data,num);
                            i=2;
                        }
                    }
                    function createLoader(i,data,num) {
                        thisLoader=eval("container_mc.loader"+i+"_mc");
                        thisLoader._alpha=0;
                        thisLoader.loadMovie(data[num].path);
                        watcher_mc.onEnterFrame=function () {
                            var picLoaded = thisLoader.getBytesLoaded();
                            var picBytes = thisLoader.getBytesTotal();
                            if (isNaN(picBytes) || picBytes < 4) {
                                return;
                            }
                            if (picLoaded / picBytes >= 1) {
                                swapPlace("container_mc.loader2_mc",1);
                                alphaTween = new mx.transitions.Tween(thisLoader, "_alpha", mx.transitions.easing.Regular.easeOut,0,100,_global.fadetime,true);
                                timerInterval = setInterval(imageGen,_global.numPause,data);
                                delete this.onEnterFrame;
                            }
                        }
                    }
                    function imageGen(data) {
                        // random, or sequential?
                        if (_global.order=="random") {
                            // choose random # between 0 and total number of images
                            while (randomNum == randomNumLast) {
                                randomNum = Math.floor(Math.random() * data.length);
                                trace(randomNum);
                            }
                            loadImages(data,randomNum);
                            randomNumLast = randomNum;
                        } else if (_global.order=="sequential") {
                            // start at 0, increment to total number of images, then drop back to zero when done
                            if (p==undefined || p==data.length && _global.looping=="yes") { p=0; } else { break; }
                            loadImages(data,p);
                            p++;
                        } else {
                            trace ("order attribute in xml isn't correct - must specify either 'random' or 'sequential'");
                        }
                        clearInterval(timerInterval);
                    }
                    stop();

                    • 7. Re: Best tool for xml-driven client-controlled slideshow for non-Flash developers?
                      Ned Murphy CommunityMVP

                      "No little "a"s" ???  I can see one in the first frame of the image you showed.  Anyways, that's the code you'll have to modify to get your new controls implemented.

                      • 8. Re: Best tool for xml-driven client-controlled slideshow for non-Flash developers?
                        kkoepsel Community Member

                        I love this image scroller and have been using it for years. However, it no longer works with the new Adobe Flash layer update v. 11.5.31.2.  It just shows a white box with no error message or images.  I love this scroller and am in desperate need for a work around.  Thank you for any help.