views:

188

answers:

1

I have Loader object containing loaded swf. I don't know how the shape of this swf looks like - it's not necessarily rectangular.

I want to add some light reflection on it. I need to mask this reflection with Loader, but in the same time I need this Loader to be visible.

I don't want to load swf twice, because it may contain some dynamic, script-generated content, which can produce different results in each Loader.

And that's quite a problem, isn't it? Any ideas?

Image: http://www.freeimagehosting.net/uploads/12e6b9cd63.jpg

A: 

you could add your instance of the loaded swf to the stage, and for the reflection use he same movieclip/sprite and draw it to a new BitmapData. do the transformations needed and then add to stage.

Or imagine the following situation, instead of having the swf that is loaded adding it's own graphics to library you could do this from the loading application, so for instance, give the instance name of MyDisplayObject to the movieclip in the loaded swf and export to actionscript. After you load the swf you could use the following code to access the library, so you can add this object number of times you need, in you case 2.

here is the code (from adobe live docs)

function initHandler(e:Event) {
var applicationDomain:ApplicationDomain = e.target.applicationDomain; // e.target is the loaderInfo object
var testClip:Class=applicationDomain.getDefinition("testClip") as Class;
var clip = new testClip();
addChild(clip);
var reflection = new testClip();
addChild(reflection);
reflection.y= 100;
}

Hope this get's you on the right track.

dome
I'm not sure if you understood me correctly. I've posted image showing situation i'm talking about. I hope it will resolve all doubts.
pawelb
The above answer might still be helpful. You still need two copies of the visual object, the second copy can then be used a a mask for the reflection effect you want to place over the first copy.
LopSae
I wich I could be any useful with your problem, but I can't see the image you have uploaded, could you upload it again?(www.freeimagehosting.net seams to be down)
dome