A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [f8]reloading fresh images in the same place

  1. #1
    will i ever get it?
    Join Date
    Feb 2004
    Posts
    707

    [f8]reloading fresh images in the same place

    normally this works for me, but i am not getting the correct results...essentially, every time i call loadThumbImages i woudl like to start a new set of images exactly where the old ones were (same starting _x and _y)...any idea why the the next set of thumbs (after a new call) load immediately where the previous set left off??? shouldn't mcHolder be removed and replaced with exactly the same mc?

    Code:
    function loadThumbImages(thumbXML) {
    	var mcHolder = this.createEmptyMovieClip("mcHolder", 2000);
    	root = thumbXML.firstChild.childNodes;
    	var nX:Number;
    	var nY:Number;
    	for (var i = 0; i<=root.length-1; i++) {
    		thumbs = root[i].firstChild;
    		mcImage = mcHolder.createEmptyMovieClip(i, i);
    		createThumbs(thumbs);
    	}
    }
    function createThumbs(thumbs) {
    	var mclListener:Object = new Object();
    	var mclLoader:MovieClipLoader = new MovieClipLoader();
    	mclLoader.addListener(mclListener);
    
    	mclListener.onLoadInit = function(mcClip:MovieClip) {
    		nextColumn = mcClip._width+5;
    		var newY = 30;
    		if (nX == undefined) {
    			nX = 800-(mcClip._width);
    			nY = newY;
    		}
    		if (nY>=450) {
    			nX -= nextColumn;
    			nY = newY;
    		}
    		mcClip._x = nX;
    		mcClip._y = nY;
    		nY += mcClip._height+5;
    	};
    	mclLoader.loadClip(rootURL+"images/"+galleryID+"/"+galleryID+"-Thumbnails/"+thumbs, mcImage);
    }

  2. #2
    Senior Member dudeqwerty's Avatar
    Join Date
    Mar 2005
    Location
    Bosnia
    Posts
    1,626
    try:
    Code:
    function createThumbs(thumbs) {
    	var mclListener:Object = new Object();
    	var mclLoader:MovieClipLoader = new MovieClipLoader();
    	mclLoader.addListener(mclListener);
                 var nextColumn:Number = 0;
    	mclListener.onLoadInit = function(mcClip:MovieClip) {
    		nextColumn = mcClip._width+5;
    		var newY = 30;
    		if (nX == undefined) {
    			nX = 800-(mcClip._width);
    			nY = newY;
    		}
    		if (nY>=450) {
    			nX -= nextColumn;
    			nY = newY;
    		}
    		mcClip._x = nX;
    		mcClip._y = nY;
    		nY += mcClip._height+5;
    	};
    	mclLoader.loadClip(rootURL+"images/"+galleryID+"/"+galleryID+"-Thumbnails/"+thumbs, mcImage);
    }
    New sig soon

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center