10 Replies Latest reply on Jun 4, 2009 10:04 AM by kglad

    slideshow movie has stopped loading all images and stalls

    wildtypitch

      I made a basic slideshow that loads and plays photos with comments from an xml file.  I've just uploaded some new photo's and edited the xml to include them but now flash stops while loading the series of photo's and just stalls.  Removing the files from the xml does not work either and now I have no movie.  Tried various was of uploading etc and nothing works, the movie runs fine in testing locally.  It's extremly anoying as it was designed to be very simple to update with new images via the xml.

       

      attached are all the relevant files

        • 4. Re: slideshow movie has stopped loading all images and stalls
          kglad Adobe Community Professional & MVP

          during the "stall" did you wait long enough for everything to load?

           

          are you loading sequentially or loading in a for-loop?  are you using code that assumes image loading will be as rapid as when loading from your hard disk?  are you using preloader code?

          • 5. Re: slideshow movie has stopped loading all images and stalls
            wildtypitch Level 1

            Not sure but I think preloaded.  I have waited it stops halfway through. Take a look here www.nathanielmcmahon.com.

             

            here is the actionscript

            import mx.transitions.Tween;
            import mx.transitions.easing.*;

            var _this = this;

            var blend:String = 'noBlend'; // disolve, fadeInFadeOut, noBlend
            var slideShowWidth:Number;
            var slideShowHeight:Number;
            var slides:Array = [];
            var speed:Number = 1;
            var slideContainer:MovieClip;
            var myShowXML = new XML();
            myShowXML.ignoreWhite = true;
            myShowXML.load("slideshow.xml");

            myShowXML.onLoad = function(success:Boolean) {
               
                if(success){
                    _this.slideShowWidth = this.firstChild.attributes.width;
                    _this.slideShowHeight = this.firstChild.attributes.height;
                    _this.speed = this.firstChild.attributes.speed;
                    _this.blend = this.firstChild.attributes.blendMode;

                    for(var i:Number = 0; i < this.firstChild.childNodes.length; ++i ){
                        var data:Array = [];
                        data.url = this.firstChild.childNodes[i].attributes.url;
                        data.title = this.firstChild.childNodes[i].attributes.title;
                        slides.push(data);
                    }
                    createContainer();
                    loadImage(0);
                }
                else{
                    trace('ERROR (could not load slideshow.xml)');
                }
            };

            function createContainer() {
                _this.slideContainer = _this.createEmptyMovieClip("slideContainer", _this.getNextHighestDepth());
                _this.slideContainer._x =215;
                _this.slideContainer._y = 0;
            }

            function loadImage(loadCounter) {
               
                var loader:MovieClipLoader = new MovieClipLoader();
                var listener = new Object();
                loader.addListener(listener);
                loadCounter = undefined == loadCounter
                    ? 0
                    : loadCounter;
                _root.myClips_array = [];

                listener.onLoadProgress = function(target) {
                    _this.preloader.textfield.text = "Loading.. "+(loadCounter+1)+"/"+slides.length+" Completed";
                };

                listener.onLoadComplete = function(target:MovieClip) {
                   
                    target._alpha = 0;
                    _this.slides[loadCounter].mc = target;
                   
                   
                    if(++loadCounter < _this.slides.length){
                        loadImage(loadCounter);
                    }
                    else{
                        _this.preloader._visible = false;
                        moveSlide(0);
                    }
                };
               
                //trace('load: ' +_this.slides[loadCounter].url);
                var mc = _this.slideContainer.createEmptyMovieClip(loadCounter, _this.slideContainer.getNextHighestDepth());
                loader.loadClip(slides[loadCounter].url, mc);
            }

            function moveSlide(slideCounter) {
               
                trace('slideCounter: ' +slideCounter+ ' blendMode: ' +blend);
               
                //debug.text += slideCounter+ ' - ' + slides[slideCounter].url +'\n';
                slideCounter = slideCounter < slides.length
                    ? slideCounter
                    : 0;
                   
                var slide:MovieClip = slides[slideCounter].mc;
                var title:String = slides[slideCounter].title;
                var textfield = getTitleText();
                textfield.htmlText = slides[slideCounter].title;
               
                textfield._y = Stage.height -textfield._height - 5;
                //trace(textfield._height);
               
                if('noBlend' == blend){
                    slide._alpha = 100;
                }
                else if('fadeInFadeOut' == blend){
                    new Tween(slide, "_alpha", Strong.easeOut, 0, 100, 1, true);
                }
                else if('disolve' == blend){
                    new Tween(slide, "_alpha", Strong.easeOut, 0, 100, 3, true);
                }
               
               
                doLater(this.speed, function(){
                    if('noBlend' == _this.blend){
                        slide._alpha = 0;
                    }
                    else if('fadeInFadeOut' ==  _this.blend){
                       
                        var fadeOut:Tween = new Tween(slide, "_alpha", Strong.easeOut, 100, 0, 1, true);
                       
                        doLater(0.5, function(){
                            _this.moveSlide(++slideCounter);
                        });
                       
                        fadeOut.onMotionFinished = function(){
                            //_this.moveSlide(++slideCounter);
                        };
                        return;
                    }
                    else if('disolve' ==  _this.blend){
                        new Tween(slide, "_alpha", Strong.easeOut, 100, 0, 5, true);
                    }
                   
                    moveSlide(++slideCounter);
                });
            }

            function doLater(time:Number, delegate:Function):Number {
                   
                var intervalId:Number;
               
                var _delegate:Function = function() {
                    clearInterval(intervalId);
                    delegate();
                };
               
                intervalId = setInterval(
                    _delegate,
                    time * 1000
                );
               
                return intervalId;
            }

            function getTitleText():TextField {
               
                if(this['titleTextfield']){
                    return this['titleTextfield'];
                }
               
                var titleTextfield:TextField = createTextField ("titleTextfield",_root.getNextHighestDepth (),15,0,180,100);
                titleTextfield.autoSize = "left";
                titleTextfield.wordWrap = true;
                //titleTextfieldt.htmlText = "<a href='http://www.myspace.com/thomasjack'target='_blank'><font color=\"#a17d4f\">MySpace page</font></a>";
                titleTextfield.html = true;
               
                var tf:TextFormat = new TextFormat();
                tf.font = 'Arial';
                tf.align = 'left';
                tf.size = 10;
                tf.color = 0x999999;
                titleTextfield.setNewTextFormat(tf);
               
                return titleTextfield;
            }

            • 6. Re: slideshow movie has stopped loading all images and stalls
              kglad Adobe Community Professional & MVP

              if your images start to load and display and then stall, at the point it stalls you have a file name problem.  ie, if the ith image fails to load, in you xml file, myShowXML.firstChild.childNodes[i].attributes.url has a file name that flash cannot find.

               

              if flash is finding that file when you run locally, then either:

               

              1.  you failed to upload that file or

               

              2.  that file name has a typo.  for example, image22.JPG looks the same as image22.jpg locally but not online.

              • 7. Re: slideshow movie has stopped loading all images and stalls
                wildtypitch Level 1

                it runs locally fine.  When uploaded it does not.  All image files are uploaded and are fine.  I have changed position of the files in the xml and the same error happens on the same number.  tried removing some of the later files and the error happens at an earlier number in the series.  The image files are not the problem.  I've downloaded the unworking swf, xml and image files and re-ran them locally and they worked. When on the hosting server thought they stop working.  visi twww.nathanielmcmahon/slideshow.swf or www.nathanielmcmahon.com with it embeded and both have the same problem so there is no html problem in the page.  Maybe javascript code has a problem but it is what is supplied by dreamweaver and have no reason to doubt it.

                • 8. Re: slideshow movie has stopped loading all images and stalls
                  kglad Adobe Community Professional & MVP

                  instead of arguing with me, read my message above it explains your error.

                  • 9. Re: slideshow movie has stopped loading all images and stalls
                    wildtypitch Level 1

                    Sorry I'm an idiot, and a terrible proof reader.

                     

                    Thank you

                    • 10. Re: slideshow movie has stopped loading all images and stalls
                      kglad Adobe Community Professional & MVP

                      you're welcome.

                       

                      sorry i was so abrupt.