Reflection Class V3 with Source
I was prompted today to update my Reflection Class. Many of you have posted updates and revisions of the class and I thank you all for that. I took some of the revisions and officially updated the class. The new class now supports clips that change their position. The old code would not allow an object to change the x position. This is now handled by telling the class how large of an area of a given clip should be monitored and reflected. View the demo below:
You can try the new class out below using the sliders to update the properties assigned. Once you have a look you like you can copy the code below for reference when using the class.
You can download the source and demos here.Thanks to Mim, Jasper, Jason and anyone else who has been using/modifying the code!
March 30th, 2007 at 10:58 pm
Very cool. I look forward to using this in the future. Thank you!
April 2nd, 2007 at 8:47 am
Same here, thanks man!
April 13th, 2007 at 8:41 pm
This is really cool! Was wondering if it would work with any Movie Clip or does it have to be a video? A sample code would be nice if it can be done.
April 14th, 2007 at 1:46 am
Howard – the code can be used with any movie clip. Just download the .as file, create a new FLA file co-located to the .as file (same directory) and paste this code into an empty frame:
import com.pixelfumes.Reflect;
new Reflect({mc:video_mc, alpha:85, ratio:255, distance:1, updateTime:0.33, reflectionAlpha:90, reflectionDropoff:7});
this assumes you have an instance name of video_mc on your movie clip – if it is different swap that out for the instance name on your movie clip.
Hope this helps!
-Sarge
April 17th, 2007 at 10:49 am
I’m trying to use this class but it doesn’t work in my own code, why?
<br/><br/>this.createEmptyMovieClip("logo_mc", 999);<br/>loadMovie("FotoShow.swf",movie_mc);<br/><br/>import Reflect;<br/>r1 = new Reflect({mc:movie_mc, alpha:85, ratio:255, distance:1, updateTime:.33, reflectionAlpha:90, reflectionDropoff:1});<br/>r1.setBounds(549,399);<br/><br/>I get no errors, but i can’t see the reflection…
.:FiDo:.
April 17th, 2007 at 12:24 pm
Fido, my guess is that the reflection is processing before the clip is loaded that you are loading with the loadMovie call. Preload that clip and ensure it is 100% loaded, once that is true, then apply the Reflect. Send me an FLA if you still have problems. Thanks.
-Sarge
April 20th, 2007 at 4:34 am
Hi, thanks for the class, very cool. The class works when symbols are contained in the flash, but when you use createEmptyMovieClip fails.
I ve been trying to use it with this code and have been unsuccessful:
import com.pixelfumes.Reflect;
var container:MovieClip = _root.createEmptyMovieClip(“container”, getNextHighestDepth());
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(this);
mcLoader.loadClip(“logo.jpg”, container);
function onLoadComplete(mc:MovieClip) {
new Reflect({mc:mc, alpha:85, ratio:255, distance:1, updateTime:0.33, reflectionAlpha:90, reflectionDropoff:4});
trace(“onLoadComplete: ” + mc);
}
If u have the solution it would be great.
Thanks,
Tomas
April 20th, 2007 at 5:29 am
Thanks for the cool code! Your recent AS makes it so easy to use however I have problem getting it to work with a FLV set to widescreen 16:9. When I set the the FLV component’s path to import to my widescreen FLV ( 400×225 ) the reflection doesnt match the widescreen is reflects a normal screen.
April 20th, 2007 at 12:16 pm
Tomas,
The class does support “createEmptyMovieClip”. The problem is the movieclipLoader onComplete event. It fires before the first frame is executed so you are reflecting a blank clip. Use onLoadInit instead. The following code worked fine for me:
import com.pixelfumes.Reflect;
var loadListener:Object = new Object();
loadListener.onLoadInit = function(target_mc:MovieClip, httpStatus:Number):Void {
r = new Reflect({mc:target_mc, alpha:85, ratio:255, distance:1, updateTime:0.33, reflectionAlpha:90, reflectionDropoff:4});
}
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(loadListener);
var mc:MovieClip = this.createEmptyMovieClip(“mc”, this.getNextHighestDepth());
mcLoader.loadClip(“logo.jpg”, mc);
Hope that helps!
-Sarge
April 20th, 2007 at 12:19 pm
Eugene,
Sounds like the reflection is firing before the FLV component has updated its size. I always wait until the video is completely loaded in my FLV e.g.:
//don’ apply effect to video until it is loaded
import mx.video.*;
var listenerObject:Object = new Object();
listenerObject.stateChange = function(eventObject:Object):Void {
if(video_mc.video.state == “stopped” && !r1){
r1 = new Reflect({mc:video_mc, alpha:85, ratio:255, distance:1, updateTime:.33, reflectionAlpha:90, reflectionDropoff:7});
update();
}
}
video_mc.video.addEventListener(“stateChange”, listenerObject);
If this doesn’t help feel free to email me the FLA and I will take a look. Thanks!
-Sarge
April 29th, 2007 at 3:52 pm
Why is it when I scroll the page, the flash player freaks out,stutters and stops? It does this for youtube and soapbox as well. But not for stage6 or wmp based services. Could that be fixed?
May 3rd, 2007 at 2:43 pm
Very nice to see you made an update including my adjustments. End offcourse all the others, looks very smooth now. Final version
I got one more idea. to mask the reflection, but that’s a personal project and maby an option for later on.
Good work guys!
May 10th, 2007 at 5:48 pm
Downloading gonna check it out…. thanks
Ranjeet naidu
flash developer london
May 17th, 2007 at 7:51 pm
this is great! but i’m having a problem with the reflection not showing up until either the entire movie plays or i drag the time slider to the end of the time bar……
Is there any way to ALWAYS keep the reflection on? Here’s my code
import com.pixelfumes.Reflect;
//don’ apply effect to video until it is loaded
import mx.video.*;
var listenerObject:Object = new Object();
listenerObject.stateChange = function(eventObject:Object):Void {
if(video_mc.video.state == “stopped” && !r1){
r1 = new Reflect({mc:video_mc, alpha:50, ratio:255, distance:0, updateTime:.33, reflectionAlpha:64, reflectionDropoff:3});
update();
}
}
video_mc.video.addEventListener(“stateChange”, listenerObject);
Thanks!
Jim
May 24th, 2007 at 3:38 am
Cool thanks. Saved my brain time…hehe
May 24th, 2007 at 12:44 pm
brillant – now just need to port it to AS3
June 12th, 2007 at 11:00 am
Nice one indeed! Just make sure you don’t have any filters in the MC you are reflecting. Processor gobble!
June 12th, 2007 at 4:39 pm
Is there anyway that you can setBounds for a certain height at the bottom of the movieclip to be reflected, rather than the top? Using a largish video gets sluggish when you setBounds for the whole video movieClip. If you could define only the bottom 70 or so to reflect then I would assume this would enable better performance.
July 4th, 2007 at 7:57 am
This Code is still ActionScript 2.0 right ?
Is it possible to change it to 3.0 ?
It does not really work with 3.0
Thanks
July 4th, 2007 at 5:28 pm
There is an old AS3 version here:
http://pixelfumes.blogspot.com/2006/06/actionscript-3-reflection-class-source.html
The new AS3 version is complete and will be posted within the next few weeks through Adobe.com hopefully.
Thanks!
July 15th, 2007 at 7:49 pm
Problem: I have absolutely no idea about flash. I have my viewer.swf script for my gallery (from airtightinteractive.com) and want to import the swf into a new swf, in witch I will put the reflection under the viewer.sfw. Undestood?
I tried to handle all the loadMovie and stuff, but still nothing is working, becouse I don’t know how to use holders, mc’s etc…
I think it should be veryvery easy for someone with just a little knowledge.
Can u help me please?
Thanks a lot
bboo
July 26th, 2007 at 3:58 pm
hi.
your class is very nice. but I have a quesitons about it.
when I reflect a movieclip button, the reflected movieclip can click too, How can I disable the reflected movieclip buttn.Thanks.
July 26th, 2007 at 4:03 pm
The best way to do what you are trying to achieve is to create a nested clip or button within the movieclip that you are reflecting and use it to handle the click event vs. using the entire clip you are reflecting to do so. You can also modify the class if you desire to make it do whatever you like!
July 27th, 2007 at 2:50 pm
Hi, Ben Pritchard
We are developing an dynamic animated image gallery with xml using Flash
8 & AS2, for which the images are called up from a different domain. I
have used the reflection class to achieve reflections. This works fine
when the images are called from the same domain. But, when the images are
called from another domain, the reflection class does not work. Although
the images are showing up. Please review the link provided. You will see
2 images that have the reflection working, these images are called from
the local domain. The other images are have a cross domain link. I also
need to mention that even on the local domain the refection functionality
is irratic.
The same file works correctly in the flash application environment, even
for the cross domain images, but when it is published in html page, it
malfunctions.
The link to view the animation please go to : http://www.isisdemos.com/carousel
I have uploaded all the project files for your review :
http://www.isisdemos.com/carousel/carousel.zip
I would really grateful if you could take the time and review this
problem, as I have been trying this for the last few days with little
success.
Thank you in advance.
Avijit Dutta
July 27th, 2007 at 3:04 pm
Avijit,
Have you tried not applying the class to the clip until after the external image has loaded? Either that or apply an update time to the clip.
-Ben
August 6th, 2007 at 9:08 am
Hi and thanks for your class is soo cool
i need help because using the reflect class i got this error message: ArgumentError: Error #2015: BitmapData not valid.
why?
thx
August 6th, 2007 at 9:12 am
Hi and thanks for the class.
i need help because using this class i got this error message: ArgumentError: Error #2015: BitmapData not valid.
why? thx
August 10th, 2007 at 5:05 am
just wanted to say very cool Class/project and thank you for sharing.
Cheers,
Steve
August 13th, 2007 at 2:46 am
hi sarge i’m Luca, you redirect me here from the old reflect class post
this new version is really cool, now supports the alpha chan of png and gif images…great! thanks a lot!
i’ve a question for you:
is possible to cover a reflection of one item with another one?
I found very difficult the solving of this problem: here you can find a very simple example of what i’m talkin about…
http://img134.imageshack.us/img134/6674/examplepc5.jpg
one mc and another one, on two different layers. the reflection of the mc behind pass through the other
as always thanks a lot for everything.
bye!
August 14th, 2007 at 9:12 pm
something very weird going on for me I just get a reflection of the top right quarter of my mc and this only appears a long way down from the mc. But if i use your box_mc with the same code it works fine which tells me the codes are cool but its a mc problem…….very odd…….any ideas?
August 14th, 2007 at 9:43 pm
Anonymous,
Check to ensure your movieclip is registered at 0x and 0y. Also check that the mc you are reflecting is not scaled – it must be 100%. The items within the mc however, may be scaled.
August 16th, 2007 at 2:40 am
It cause a high loading of the CPU ~
August 16th, 2007 at 11:24 pm
Awesome work, I really have to thank you for this.
But I’m having a little flickr sometimes when using this while loading the swf to a movieclip.
anyone had the same problem or have any idea why this happens?
August 26th, 2007 at 8:28 pm
I have been successfully using this awesome class – many thanks!
I do run into a problem though, if the reflected movieclip has several frames inside or if there is a tween inside the movieclip. Is this expected and do you know of a workaround? I tried creating a nested clip that contained the tweens but that did not work. I always place the script outside the clip at frame 1. Placing it in the clip’s onClipEvent(load) { } event also did not work.
August 26th, 2007 at 10:07 pm
Natacha – can you send me a sample FLA to test out? Thanks!
August 28th, 2007 at 11:18 am
Hello Sarge,
I have uploaded a sample zip (flash CS3 file) here:
http://www.buildingblock.com.au/reflect_sample_code.zip
The video layer works.
(remove the guide setting on the layer to review)
The image layer does not work.
I thought it was if there was a tween in the clip, but I have reproduced the problem with this (seemingly) basic movieclip.
Thanks again.
Natacha
August 28th, 2007 at 12:59 pm
Natacha – I figured it out. Check the zip out here:
http://www.pixelfumes.com/blog/aug07/refNatacha.zip
Check out the jpg screenshot in there for an explanation. Basically your image was “group masked”. Take a look.
August 28th, 2007 at 4:06 pm
Thanks very much for taking the time to check out the problem – I am always amazed at the open source community out there and where you guys find the time
So from your response I take it I cannot mask a larger image then reflect that clip? (even by nesting this clip within other movieclips?
The reason I was using the large image is that this was in a nested clip that had tweening (ie the large image pans slowly from left to right).
So I take it that it is not possible to reflect a clip that contains an animation contained within a masked area?
August 28th, 2007 at 4:09 pm
Natacha – yes – that is correct. The class could be easily modified to handle other situations too. Feel free to play around with it!
August 31st, 2007 at 7:59 pm
wondering is theres a way of stopping and starting the reflection from updating. so it uses less CPU. great class BTW.
September 17th, 2007 at 8:53 pm
Hi,
I am sure this is all a little old to you now, but I have used the class in a basic way before and loved the results, so I hope you can help. I have a very simple xml slideshow (just fading images) running into an empty movie clip. When I try to reflect the imageLoader clip it fails, I assume because the clip is reflecting before the images load into it?
I read comments with your advice to preload, but being a bit of a muppet with AS2, or indeed 3, at this stage, I have struggled with linking the preload to the class.
I am back to the very basic stage at the moment, code is;
imageLoader.loadMovie(“slideshow_as.swf”);
import com.pixelfumes.Reflect;
r1 = new Reflect({mc:imageLoader, alpha:85, ratio:255, distance:1, updateTime:.33, reflectionAlpha:90, reflectionDropoff:1});
r1.setBounds(480,imageLoader._height);
Which of course doesn’t work! Any advice would be great.
Cheers,
Will
October 1st, 2007 at 1:18 pm
I love this class!
But, I have a problem….
I’m dynamically adding FLVPlayback complonents in to an mc that is being reflected. when I do, the reflection stops working.
If I use a video symbol instead, then I get the reflection. However I don’t want to use this as I am using other playback components and don’t fancy the idea of writing these from scratch.
any help greatly appreciated!
w33b
October 1st, 2007 at 1:19 pm
w33b,
Can you send me a sample FLA to test your problem out? sgtpritchard at gmail.com Thanks.
October 23rd, 2007 at 2:22 am
Thanks so much, I love it when smart people can help me out. Designing is one thing, but coding hurts my brain.
One question, is there any way to skew the reflection, or to put some perspective into it?
October 23rd, 2007 at 2:14 pm
There are ways to skew the reflection using Matrix Transforms. I have some stuff I worked on here but nothing ready for release. Back in the day someone had done it with an old version of this class. Maybe someone will take it upon themselves to add the functionality
.
October 25th, 2007 at 3:30 am
I had to remove this from a website I am launching tonight due to very high CPU usage. Not so bad in IE, but Firefox will crawl to a stop when reflecting about 15 movieclips. It has to be due to the interval. An option to turn that off would be great.
October 25th, 2007 at 12:17 pm
j-sizzle – there is an option to do that already. Set the update time to 0.
October 26th, 2007 at 10:05 pm
Aha! Should havee looked a little harder. Thx!
November 18th, 2007 at 5:48 pm
This is great!
I am using a class named: AFC_Reflection But your class is more robust than this.
There is a problem with that class; when my movie moves up, I have to chance the reflection distance manually…
Does your class can handle it or works as the same with AFC_reflection class?
November 19th, 2007 at 3:21 am
Sorry, this functionality is not currently in the class.
November 27th, 2007 at 9:57 pm
Nice work!
If the registration point of the movie clip is not 0,0 the reflection doesn’t work. Do you have any sugestion?
Thanks!
December 5th, 2007 at 6:41 pm
Regarding turning off reflection updating: In a previous post the solution was to set updateTime = 0.
I’m doing this and it’s not working. What am I doing wrong?
r1 = new Reflect({mc:maincontent, alpha:35, ratio:27.3, distance:0, updateTime:1, reflectionAlpha:100, reflectionDropoff:0});
and further down the timeline, when I want to stop updating, I do this:
r1.updateTime = 0
Reflection keeps updating and eating CPU.
December 7th, 2007 at 7:20 pm
Hi!
I’m developing a gallery using AS2 and have used your fantastic reflection class to achieve mirroring.
It works fine, when I use the correct URL (http://www.mydomain.com). But when I try to call the images from a sub-domain (http://pictures.mydomain.com) or from a incomplete URL (http://mydomain.com) the reflection does not appear. I put a crossdomain.xml to the root of the server but it didn’t work.
System.security.loadPolicyFile script also placed in the code.
Any idea what’s the problem?
Cheers!
oliver
email4you{at}email{dot}de
December 7th, 2007 at 7:39 pm
oliver,
I don’t have much experience with cross domain policies but that would be my first guess – especially if through the IDE you get errors saying such. Otherwise is it potentially a pathing issue? Sorry to be of so little help.
December 7th, 2007 at 10:28 pm
Oliver, you need a cross domain policy file on the server from which you are loading the image you want to apply the reflection to. Adobe does not allow bitmap data operations on images loaded from other domains unless the policy file is there and is loaded ahead of time.
http://www.adobe.com/livedocs/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000353.html
December 12th, 2007 at 3:01 pm
@sarge, @pk
Thanks for your reply!
@pk I added a crossdomain.xml to the server but I have still the same problems. I’m using ActionScript 2 but the sample is for ActionScript 3. I’m at my wits’ end
Cheers!
oliver
email4you{at}email{dot}de
December 20th, 2007 at 11:01 am
The way ive been doing the update is r1.updateTime:-1. I havent noticed any slow downs.
December 24th, 2007 at 10:40 pm
I can one erro and need help.
The class or interface
‘com.pixelfumes.Reflect’ could not be loaded.
Leo
December 27th, 2007 at 4:54 pm
Leotaku, please ensure that you have the Reflect.as file nested in the proper directory structure and co-located to your FLA file. For example, the Reflect.as file needs to be nested in a com > pixelfumes folder. If you download the example files and extract them while maintaining the directory structure everything should be in the correct place. Thanks!
December 27th, 2007 at 10:04 pm
Thank you now if I me work.
Regards Leotaku (Bs As Argentina)
December 29th, 2007 at 9:01 pm
first off let me say…cool!
I want to reflect all…not only one movie.
Is it possible to reflect a movie with movies inside?
gr. LT
December 30th, 2007 at 8:16 pm
LT, you can create multiple instances of the Reflect class for each individual movie clip (e.g. r1, r2, etc). The simplest way would be to nest each clip to be reflected into one parent clip and then just have one reflect on the parent clip thus reflecting all of the clips inside as well. Either way would work.
December 31st, 2007 at 9:45 pm
proberly I did something wrong..It works now. Thnx voor de quick reply.
I tried putting the update to 0 but its still running heavy. On my own comp. it runs oke but when I test it on a P4 motion tweens are running very slow etc. CPu at 60/70%
I am not reflection a video…
Is there a solution to fix this.
January 1st, 2008 at 1:10 am
LT, 0 would actually be the fastest update time you could use and thus the most processor intensive. A higher time will sample the reflection less often and improve performance. An update time of -1 will not update the clip at all and will have the lowest CPU usage.
January 4th, 2008 at 2:02 pm
As in another post comment stated I’ve modified this class a little bit to support a blur effect. Additionally the reflection will be send down to the lowest depth in the container so all your items keep in front of it. This is useful for distance < 0.
Furthermore I cleaned up the code to prevent warnings in the FDT.
my blog posting
January 5th, 2008 at 8:48 pm
I am loading pictures from an xml file via a loop. What is the best way to use this class to get a reflection on the dynamically loaded pictures?
January 7th, 2008 at 1:47 pm
Ben,
Apply the reflections to each picture after the load of each picture is complete – only then. One other option is to load the pictures into a parent clip and simply reflect only the parent clip – again, you may need to wait until all assets are loaded before trying to reflect anything. Hope this helps!
January 14th, 2008 at 10:07 pm
hi, great class first off. I want to know if there is anyway to reflect more then one movieClip, without copying the code over and over. is there a way that i can tell the class to reflect multiple movieClips?
January 15th, 2008 at 1:17 am
bboyrush1234, the simplest down and dirty way to do that would to be to nest all clips you wish to reflect into a wrapper clip then simply reflect the wrapper – make sense?
January 25th, 2008 at 11:09 am
I had problems when using this class with flickering in firefox and opera on pc. I’m going to look into what was causing this, just wanted to alert the developers out there that if they have flickering and strange rendering behaviour in firefox and opera on pc then try removing this class. I like the effect and will do my best to get to the root problem.
March 4th, 2008 at 10:13 am
Hi,
at first very cool class!
I have the refelction working fine on PC! But on my Mac neither with Safari nor Firefox the reflection is shown?!
Is there a known Problem in some constellations that the reflection is not shown on a Mac (Safari/Firefox)?
regards marcus
March 4th, 2008 at 1:42 pm
Marcus, it shouldn’t matter. I would make sure that you have Flash 8 or higher installed in your other browsers (Flash 9 if using the AS3 version) If you still have problems you can email me your FLA at sgtpritchard at gmail.com
March 4th, 2008 at 3:04 pm
Hi sarge,
thanks for your quick reply.
I just found out what was wrong.
Due to design and the image I wanted to reflect, I have to change the x-position of the reflection.
Shame on me … I tried some changes on reflectionBMP.x value in line 71, which worked well for the PC but crashed on my mac…don’t know why?!
Is there a save way to adjust the x-position of the reflection relative to the image.
Thanks in advance and
kind regards
marcus
March 4th, 2008 at 3:10 pm
Marcus, yes you can do so. You can either modify the Reflect class or do it after the fact by targeting the nested items that are created by the class. You will likely have to open the class and find what it is you wish to move. There is currently no method to do so built into the class.
April 16th, 2008 at 7:13 pm
Hi Sarge,
Thanks a ton for making this available. I plan to use it on a new project.
While doing some preliminary testing I noticed that the reflection was off by a pixel or two when applying it to a MC containing vector art and/or a bitmap. My guess is that some of the math causes the numbers to drift. I’ve experienced this before due to floating point calcs I think. As a quick-fix I modified the following lines in your object code:
From:
Line #22: var mcHeight = (mc._height/mc._yscale)*100;
Line #23: var mcWidth = (mc._width/mc._xscale)*100;
To:
Line #22: var mcHeight = Math.ceil((mc._height/mc._yscale)*100);
Line #23: var mcWidth = Math.ceil((mc._width/mc._xscale)*100);
It seems to work well. The reflections are spot on now, but I’m worried that it may have some other impact that I’m not aware of. Do you have any feedback or cautions against me doing this?
Thanks!
.spa
April 17th, 2008 at 8:33 am
Spa – that looks good. Test ‘er out and let me know what you get. I would imagine the additional calculations would have some overhead but I am sure that it will likely be minimal.
May 17th, 2008 at 7:23 pm
hi, i try to see your reflect code and fla. very intresting, but i need to have same indication. i try to import a new video on the fla example, but i can’t understand why doesn’t work….there are some specific way to import a video? thanks a lot, dino
May 17th, 2008 at 11:07 pm
Dino, send me your FLA and video to sgtpritchard at gmail.com and I will take a look. Thanks!
May 18th, 2008 at 7:49 am
i sent a fla and video thanks a lot
May 21st, 2008 at 11:48 am
http://www.mediabarninc.com/creative/portfolio.html
In Firefox (PC only) the first thumbnail reflection is flickering. It’s more substantial on older machines but prevalent in all I’ve tested.
Any suggestions on what I may do?
Thanks,
Dahs
May 22nd, 2008 at 3:03 pm
Dahs, I took a look in Safari and Firefox Mac and Firefox PC. It looked good in all of them. I think it flickered once or so on the Firefox PC but I couldn’t reproduce every time. It may have been a figment of my imagination. I thought it looked really good.
May 28th, 2008 at 6:36 pm
I’m having the same problem as mojito. For some reason in firefox and opera, the movieclip reflected by the class flickers and jitters all crazy like. haven’t yet been able to fix it, besides just removing it.
But when viewing this page in firefox, your videos and images reflect fine. So i guess it’s an implementation problem on my end. maybe when other masks are involved outside or inside the reflected object? anyone else having this problem?
May 28th, 2008 at 6:38 pm
ah, just saw the more recent comments. woops. so i’m not the only one. i’ll keep workin on it.
June 14th, 2008 at 6:00 am
Looks great. I just feel like an idiot because I can’t get it to work on the simplest movieclip.. Help!
June 17th, 2008 at 9:01 am
PK, send me the FLA of what you are trying to do.
July 3rd, 2008 at 11:32 am
Hi… i’m really “tabu” on action scriping so…
how can i add your class to a text animation make with “txeff”?
Please… help me!
July 4th, 2008 at 12:27 pm
i don’t know action scripting… how can i implement this class to a txeff text?
Please help me!
July 6th, 2008 at 9:38 pm
Hello, I think my question is going to be too late issue!?
your as is really great, it worked for one MC, but second MC did’t.
Both mcs’ are on the same scene, but different MC and different instance name.
And also I tried to load MC, but it did’t work.
Please help me….
July 14th, 2008 at 12:15 pm
Koko, send me your FLA and I will take a look. sgtpritchard at gmail.com
August 16th, 2008 at 7:21 am
[...] Tweener: http://code.google.com/p/tweener/ Reflect: http://blog.pixelfumes.com/?p=152 [...]
August 27th, 2008 at 9:16 am
This is a great class, thanks a lot for making it available.
2 questions…
1 – For some reason I cannot get the reflection to display on my external swfs when they are over approx 300kb. On smaller loaded swfs it works fine. It is a fairly image heavy site so swfs of this size (containing several images) cannot really be avoided. Any ideas?
2 – I wish to have a main page title below the images which currently gets covered by the reflection. Is there a way to make this title mc always above the reflection. I have had a play with swapping depths but with no success.
Many thanks in advance.
September 22nd, 2008 at 2:05 pm
@towel
have you tried putting text on adjusting layers?means text layer should be on the top that might could help you
September 22nd, 2008 at 2:06 pm
ben i am having troubles using xml images and pixelfumes over image preloading….can you please help i have comment on your blogspot blog
thanks in advance
September 24th, 2008 at 11:26 am
akshay, send me your FLA at sgtpritchard at gmail.com and I will have a look.
November 14th, 2008 at 1:49 pm
Awesome class – strange issue: creating an reflect instance somehow kills all my events. Here’s my code:
function createReflection() : void
{
for ( var i : Number = 0; i < mcAllProducts.numChildren; i++ )
{
var mcProducts : MovieClip = mcAllProducts.getChildAt( i ) as MovieClip;
var mcImages : MovieClip = mcProducts.mcImages;
var reflection:Reflect = new Reflect( { mc : mcImages, alpha : 50, ratio : 50, distance : -5, updateTime : 0, reflectionDropoff : 0 } );
}
}
if I comment out the reflection line, all is fine. If I apply the reflection, I get no more events. Thoughts?
November 14th, 2008 at 1:52 pm
weird – rearranging the layer order in Flash solved the issue. I moved the reflected mc’s under the even-firing mc’s. without reflection, it didn’t matter, but with it, no events.
December 14th, 2008 at 7:30 pm
I have not really be able to get this class to work, partly because I’m just really getting a hang on actionscript 3.0, so perhaps I’m doing something wrong with your class but basically I get nothing when I make a box on my stage convert it to a movie clip then insert your code to make a reflection under it. Now I know this is a simple thing but again im just getting started so taking baby steps before using more advanced properties and methods with your class but hopefully you can tell me why no reflection shows when the code is set up like this:
import com.pixelfumes.reflect.*;
var r1 = new Reflect({mc:box_mc, alpha:50, ratio:100, distance:0, updateTime:-1, reflectionDropoff:0});
now if i change the ratio to 255 it shows a reflection but way off center and below. Is there any other documentation or examples you have somewhere I can pick through and try to help get a grasp on using this?
December 18th, 2008 at 11:30 pm
Ben-
Did you ever address the issue of not having the source placed at 0,0? Was playing with the new 3D effects and needed to have the image set with a registration point in the center, upon doing so I lost the reflection.
I did find a work around, if I nest the image inside another clip with it’s registration in the center and set the image back to 0,0) the reflection will work and the image properly rotate.
January 13th, 2009 at 4:44 am
Hey Chris,
I am trying to do the same thing here. I am using gotoAndLearn’s 3D Video flip script and I’m trying to apply this Reflection to it. I basicaly did the same workaround except for me, the reflection is way at the bottom away from my mc. How come the reflection is not right at the bottom of my MC it’s starting to drive me crazy!
January 29th, 2009 at 2:01 am
Hi, I have my flv reflecting nicely, but it has choppy audio when I run it online, and also through Simulate Download. When I disable the reflect script the audio is fine. Any ideas?
January 29th, 2009 at 9:43 am
Try changing the update time.
May 14th, 2009 at 3:01 pm
[...] You can download the latest Actionscript 3 Reflection Class here [...]
July 9th, 2009 at 3:52 am
hi, I try to reflect image – but reflection is not smooth – would you fix it? It`s just few params in attacheBitmap
July 9th, 2009 at 1:19 pm
There is nothing to fix. Feel free to modify the class to fit your needs and try changing the update time to null if you don’t need the reflection to update. There is also an AS3 version here: http://www.adobe.com/devnet/flash/articles/reflect_class_as3.html
October 26th, 2009 at 8:17 pm
This is extremely handy, however would it be possible to add a blur effect to the reflection to give it that extra depth and realism?
December 13th, 2009 at 9:55 am
Hi, I keep getting this error.
An ActionScript file must have at least one externally visible definition
What’s it mean ?
December 17th, 2009 at 7:00 am
hi there, thanks for this great script. i use it to reflect a kind of turn-around-animation. works great, but the reflections turns in the wrong direction. what’s wrong, any ideas?
http://kunden.schattenwerk.ch/reflect/
thx!