[Flashr] Photo movieclip help

charles carlson ccarlson83 at yahoo.com
Wed Aug 13 17:07:36 PDT 2008


works great.  Thanks Kelvin!

--- On Tue, 8/12/08, Kelvin Luck <kelvin at kelvinluck.com> wrote:
From: Kelvin Luck <kelvin at kelvinluck.com>
Subject: Re: [Flashr] Photo movieclip help
To: ccarlson83 at yahoo.com, flashr at osflash.org
Date: Tuesday, August 12, 2008, 11:23 PM

Hi,

The simplist way might be to pass a reference to the photo into the movieclip.

e.g. - just after your mc._alpha line add this:

mc.photo = thisPhoto;

And then change this line:

mc2.my_txt.text = thisPhoto.title;

to:

mc2.my_txt.text = photo.title;

Hopefully that will work - it's been quite a while since I've
programmed any AS2... If not let me know and I'll try and suggest another
approach,

Hope that helps,

Kelvin :)

On Fri, 08 Aug 2008 15:30:19 -0300, charles carlson
<ccarlson83 at yahoo.com> wrote:

> 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();
> 		}
>
>
> }
>
>
>
> 
>
> _______________________________________________
> Flashr mailing list
> Flashr at osflash.org
> http://osflash.org/mailman/listinfo/flashr_osflash.org
> 






      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/flashr_osflash.org/attachments/20080813/fefeedb2/attachment.html 


More information about the Flashr mailing list