OK, I've got it working where it rotates between the SWFs. But I can't
understand why the statusbar is constantly saying
"Reading www.listinventory.com"
Is there a way to stop that from happening?
Also, when I change the code in the onEnterFrame to increment movieIndex
instead of decrement, it doe not loop more than once. Any ideas?
PHP Code:
var ar_movies:Array = new Array(); var ar_links:Array = new Array(); var my_lv:LoadVars = new LoadVars(); var movieIndex:Number = 0; var depthNum:Number = this.getNextHighestDepth(); var container_mc:MovieClip = this.createEmptyMovieClip("container_mc", depthNum); var MCL:MovieClipLoader = new MovieClipLoader(); var mListener:Object = new Object();
mListener.onLoadInit = function(target_mc:MovieClip) { var playedOnce:Boolean = false; var url:Array = target_mc._url.split("/"); var fileName:String = url[url.length-1]; target_mc.onEnterFrame = function() { if (this._currentframe == this._totalframes) { delete this.onEnterFrame; this.stop(); if (playedOnce == false) { playedOnce = true; MCL.loadClip(ar_movies[movieIndex], container_mc); if (movieIndex == 0) { movieIndex = ar_movies.length-1; } else { movieIndex--; } // if (movieIndex == 0) /* // If I try it this way, it won't rotate back to the first movie. if (movieIndex == ar_movies.length) { movieIndex = 0; } else { movieIndex++; } // if (movieIndex == ar_movies.length) */ trace(movieIndex); }; // if (playedOnce == false) }; // if (this._currentframe == this._totalframes) }; // target_mc.onEnterFrame = function() }; // mListener.onLoadInit = function(target_mc:MovieClip) MCL.addListener(mListener);
my_lv.onData = function(src:String) { /* The data is loaded in like a query string this format: index0=http://www.mysite.com/movie1.swf&index1=http://www.mysite.com/movie2.swf&cant=2
variable cant is noo longer used. */ if (src == undefined) { trace("Error loading content."); return; }; //if (src == undefined) my_lv.decode(src); x = 0; for (var prop in my_lv) { if(prop.indexOf('image') > -1) { ar_movies.push(my_lv[prop]); x++; }; // if(prop.indexOf('image') > -1) }; // for (var prop in my_lv) MCL.loadClip(ar_movies[movieIndex], container_mc); movieIndex++; }; my_lv.load('http://www.listinventory.com/banner.php', my_lv, "GET");
The bottom one is how it is currently done on our site, but since I am trying to rotate several SWFs I need the rotator SWF to handle that.
The other SWF that I load, the link is at the bottom of this post, scales perfectly for the stage in the rotator.
How do I make sure the loaded clip(s) are scaled to the stage?
container_mc.width = 715;
container_mc._height = 90;
this.stage.width = 715;
this.stage.height= 90;
this.stage.scaleMode = noScale;
this.stage.scaleMode = exactFit;