[Flashr] simple tag search

Kelvin Luck kelvin at kelvinluck.com
Sun Dec 24 09:17:16 EST 2006


Hi Gloria,

Sorry for the slow reply...

gloria kao wrote:
>     Message: 1
> 
> I am sort of newbie in actionscript, so I have taken some time to check 
> your sample http://kelvinluck.com/article/flashr-code-example,
> and I have two tiny questions:
> a. you wrote " function onPeopleGetPublicPhotos(p:Person):Void ... " in 
> the sample, which means you override this function
> function onPeopleGetPublicPhotos(	person:	 Person,
> 
> 	resultsSet:	 ResultsSet	)
> 
> because you don't want to bother with the resultsSet?
> 

Hmmm. That example is written using Flashr 0.3 which doesn't pass a 
ResultsSet to onPeopleGetPublicPhotos...

It is very old code in that example, your best bet may be waiting until 
I manage to get together my examples and tutorials for Flashr 0.5 
(hopefully over this holiday).

> b. why you need to write " mc.photo = thisPhoto; "  after you have 
> called the "loadMovie"  to load the picture onto the movie clip 
> (mc.jpgHolder) ?
> mc.jpgHolder.loadMovie(thisPhoto.thumbnailUrl );
> And since mc is a movie clip, but there is no property called photo 
> belong to a movie clip while I searched the help menu.

A movieclip is dynamic so you can add any properties you like to it. By 
setting mc.photo it means that when that clip is clicked on you can 
access the photo using this["photo"] in the button listeners.

This isn't necessarily the best practise way of doing things but I was 
trying to put all the code in one file to simplify the example. It does 
introduce some confusion with scope though...

> 
> c. I saw you create a nested movieclip, but you don't increase the level 
> of the jpgHolder as you increase the level of the parent mc, why?
> My rough guess is the parent mc is based on the whole stage and the 
> jpgHolder is based on their parent mc?
> var mc: MovieClip = _target.createEmptyMovieClip( "photo"+i, i);
> mc.createEmptyMovieClip( "jpgHolder", 1);

Yes, in flash each movieclip has it's own set of depths. So the 
jpgHolder movie clip is attached at depth 1 within it's parent movieclip 
which is attached at a depth of i inside _target.

> 
>                        
> Thank you for all the answers. Merry Christmas!
> 
> 

Hope they are helpful. It may also be worth signing up to the 
Flashcoders mailing list:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

To ask general questions about how flash and AS work - you'll probably 
get answers a lot faster there,

Cheers,

Kelvin :)



More information about the Flashr mailing list