Ho visto. Modifica lo script così:
codice:#initclip // Component Parameters //Constructor function SlideShowClass() { this.init(); } SlideShowClass.prototype = new MovieClip(); //Initialize the component SlideShowClass.prototype.init = function() { this.panel_mc._visible = this.showPanel_param; var panel_color = new Color(this.panel_mc); panel_color.setRGB(this.panelColor_param); this.label_txt._visible = this.showTitle_param; //Remember original container width and height this.origWidth = this.container_mc._width; this.origHeight = this.container_mc._height; this.center = this.container_mc._x + (this.origWidth / 2); //Current pointer to a position in the arrays this.imagePointer = 0; //Load the first image this.loadNextImage(); } // init //Load the next image into the container movieclip SlideShowClass.prototype.loadNextImage = function() { this.container_mc._alpha = 0; this.container_mc.loadMovie(this.directoryPath_param + this.fileNames_param[this.imagePointer]); this.label_txt.text = this.imageTitles_param[this.imagePointer]; //Wait for image to load before counting down to next image clearInterval(this.loadNextID); this.loadCompleteID = setInterval(this, "waitForLoadedImage", 100); this.imagePointer ++; if(this.imagePointer >= this.fileNames_param.length) this.imagePointer = 0; } //Wait for image to load completely before resizing and //counting down to the next load. SlideShowClass.prototype.waitForLoadedImage = function() { if(this.container_mc.getBytesLoaded() > 4 && this.container_mc.getBytesLoaded() == this.container_mc.getBytesTotal()) { clearInterval(this.loadCompleteID); this.loadNextID = setInterval(this, "loadNextImage", this.interval_param * 1000); //Reset to original scale this.container_mc._xscale = this.container_mc._yscale = 100; // Test for over-sized image if(this.container_mc._width > this.origWidth || this.container_mc._width > this.origHeight) { // Test for displayMode_param if(this.displayMode_param == "Maintain Aspect Ratio") { var wRatio = this.origWidth / this.container_mc._width; var hRatio = this.origHeight / this.container_mc._height; //Test if it's too wide or too tall if(wRatio < hRatio) { //too wide, shrink to fit width this.container_mc._width *= wRatio; this.container_mc._height *= wRatio; } else { //too wide, shrink to fit height this.container_mc._width *= hRatio; this.container_mc._height *= hRatio; } // if-else wider or taller } else { // Exact Fit this.container_mc._width = this.origWidth; this.container_mc._height = this.origHeight; } // if-else Maintain Aspect Ratio or Exact Fit } // if oversized this.container_mc._x = this.center - (this.container_mc._width / 2) this.container_mc._alpha = 100; } // if loaded } // waitForLoadedImage Object.registerClass("FSlideShowSymbol", SlideShowClass); #endinitclip

Rispondi quotando