[Flashr] Photo movieclip help

charles carlson ccarlson83 at yahoo.com
Fri Aug 8 11:30:19 PDT 2008


I'm not the most advanced programmer so I'm hoping you guys could help out on a bit of code. I'm using the UserRecentPhoto.as demo file right now.

Is there a way to call a certain photo movieclip in the for loop section so that I can grab the photo's title and other information to put into a dynamic text box on rollover?  Right now when I rollover any photo, it calls the last  'thisPhoto.title' of the loop.

here's an example of my for loop code:

mc2.createTextField("my_txt", 1, 100, 100, 300, 100);

for (var i:Number=0; i<photosArray.length; i++) {

		var thisPhoto:Photo = Photo(photosArray[i]);
		
		var mc:MovieClip = _target.createEmptyMovieClip("photo"+i, i);
		
		mc._x = (i%6) * 75;

		mc._y = 20 + Math.floor(i/6) *20;

		mc.createEmptyMovieClip("jpgHolder", 1);

		mc.jpgHolder.loadMovie(thisPhoto.mediumUrl);
		
		mc._alpha=25;
		
		mc.onRollover = function(){
			//trace(thisPhoto.title);
			this._alpha=100;
			this.swapDepths(_root.x);
			mc2.my_txt.text = thisPhoto.title;
		} 

mc.onRollOut = function(){
			this._alpha=25;
			mc2.my_txt.text = " ";
		}
		
		mc.onPress = function(){
			//trace("onPress");
			startDrag(this, false);
		}
		
		mc.onRelease = function(){
			//trace("onRelease");
			stopDrag();
		}


}



      



More information about the Flashr mailing list