Flash vCam AS3
Announcing vCam AS3 for Flash! For those who aren’t familiar with vCam, I’ll offer a brief explanation. In 2005, Sham Bhangal and Dave Dixon released the original vCam or “virtual camera” for Flash. Let’s
say a Flash developer is working on an animation and wants the animation to pan from left to right. Without the vCam, the developer would have to create tweens for each layer in the timeline. Using the vCam, however, the developer can animate a single vCam instance on the timeline to create the same pan. Simply place the vCam on the left side of the stage and create a motion tween to the right side of the stage. Publish out the file and the scene pans with a single tween! The original vCam can also be used to adjust size and add color transformations.
Now vCam AS3 brings a new array of options with added features including:
- Rotation
- Blur
- Brightness/Contrast
- Hue/Saturation
- and more!
Sham and Dave were very generous and offered the original vCam free of charge. Therefore I am also offering this new version for free. Have fun all!
Download vCam AS3 FLA (Requires Flash CS3 and Actionscript 3)
*** Note: A bug in Flash CS3 causes stage.stageHeight to be -100 the actual stageHeight if the bandwidth profiler is open. Either close the profiler or view the SWF outside flash.
Download vCam AS2 FLA (Requires Flash 8 and Actionscript 2 – performance may suffer)
The animation below shows the vCam AS3 animated on the stage:
The animation below is the resulting swf file:
Artwork by Josh Menas | Composited by Tim Allen 55 comments
55 Comments so far
Leave a reply
Fantastic! I’ll link to this article on my next blog update. Nice demo too! Thanks for keeping the vCam alive
-Adam
Thank you so much for adding those new features! I’m so happy to be using this in my next flash animation.
Hi! Terrific piece of code.
The only thing, the AS3 (unlike AS2) version seems to be distorted, is this possible?
Just open the fla, and it seems strechted, even though I leave the vcam the same size as the stage (100% x 100%)… but i don’t see why, any ideas?
It’s a bug in Flash CS3. You need to make sure the bandwidth profiler is closed when viewing it in Flash. For some reason if bandwidth profiler is open the value of stage.stageHeight is -100 what it should be. Try closing the profiler or running the swf outside of Flash and it should show up fine.
@bryan: Unbelievable, you are right
… thanks alot!
Thanks so much for making this available.
This is brilliant!
Hey there,
great vCam! I only have one question: is it possible to trigger events like buttons on the Stage? Somehow it´s not working when vCam is attached?
Greetings
Very nice! Thanks for sharing.
Damn thats good.
Amazing, thanks a bunch.
This an excellecent peice of code actually…and it makes flash animators lives so much easier
This is great, But when I use the one for as 2.0 buttons don’t work.
What a brilliant idea! Well done on this
Never mind. I think I figured it out. When the video is stretched to be larger than it should be (which firefox and internet explorer do when you open the file using them) the camera doesn’t stretch with it, cutting off some of the video. If you were to upload it to your website and not stretch it out to be larger than it should be, it should work fine.
This looks excellent, but I have one question if you don’t mind answering.
Does the AS3 camera shift the coordinates of the stage slightly like Sham Bhangal’s original?
Wow, that’s real good, sometimes so small things make us so happy, isn’t it? Very good job. Thank YOU!
Anyone know an easy way to make this work with movieclip buttons/interactions on the stage? It’s a very neat tool, but I was hoping to incorporate some interactivity as well
Brilliant! You’re a legend!
em:
“Brilliant! You’re a legend!”
Yes, kind of: you must remember this vcam is based in a “hack” by Sham Bhangal whom made it for the one and only Adam Philips, a legend of flash animation. In fact, read the “credits” in the animation-demos.
Of course, we must thank this tweak, as the original camera hasnt been updated since i dont remember when.
Hail to the king.
i think this is a great idea,i just wish there was a MX version
[...] Today i’m just going to share one of the most useful tools for animators in Flash. It is the virtual camera class. Although i lean more to the technical side i can’t help but admire [...]
Hi there! Great, lovely hack. Does anyone know how to make it work with the keyboard?
I want to be able to move the viewfinder up/down/left/right while the movie is running.
The only immediate solution I can think of is maybe using tweening and setInterval…but that solution is kind of ugly and devoid of true “dynamic” positioning
Isn’t there another way to achieve this that’s more elegant?
Any ideas, guys? Any more geniuses out there?
BTW, just moving the viewfinder using viewfinder._x and a keylistener w/o any tweening won’t work
Thanks for a great app.
This is amazing i love it you sir and or maddam are a geniues
how can I change the colors like the swf file??
I don’t found any tuto on the web, and sorry for my bad english xD
do you know if this will work with flash cs4 when it comes out or do you have to code a new one for cs4?
CS4 uses Actionscript 3 so it should port over fine.
This is a great stuff. Did anyone see a flash game with using vCam? I am curious to see a game using this code. But it seems that we ave an interactivty problem here.
WOW this is sooo cool
i could never get the vcam to work for me until now!
I just have to figure out how to control this one and ill be on easy street, yay!
Thank you so much! this is so helpful for a beginner
[...] me; hand drawn in Flash CS3. Those fancy camera movements you’re seeing are achieved by the vCam actionscript tool. Voice overs were done by friends of mine, and a few of the smaller parts were done by myself. [...]
Aside from this being really cool,, which it is. What is the benefit of using this versus, scaling and tweening a main movieclip on the stage?
I dont see any DOF or lens flare.
I could be wrong, i am often.
wow cool thanks for the source file.
Regards
Omair Rais
http://www.omairarts.com
Love this code! Thanks a lot guys, this will come in very handy.
Brilliant! Simply brilliant. I teach flash programming at High school and my students showed me this fantastic tool. Thank you so much for giving it away freely. Now my students and I can animate in a much faster time frame. Thanks again.
Thank you sooo much for this updated Vcam. Do you know where I can find a tutorial for this though?
Amazing, great job.
Okay this is amazing. I just wanted to let you know. Thank you.
It is very useful thing! Many thanks to the author!!!!!
you can’t press buttons on the stage when the camera is active. Is there any way to fix this?
@Andrea
in September 12th, 2008 6:13 am
try using x instead of _x
Great update! Glad to see that the vcam has been ported to AS 3.0. My only complaint is the same one that Robert reported – once a swf which uses vcam has been published, you cannot change the display dimensions of the swf (e.g., swf published at 640×480, but you want to display it on an html page at 550×400). Although this didn’t seem to be an issue with the old vcam, this version of vcam does not seem to adapt well to that (new vcam stays static, keeping the publish dimensions). The workaround is to publish at whatever settings the swf will be displayed at on the web page, but this is not always desirable. Any suggestions on this?
Otherwise, great job! Thanks so much!
thanks for the catch. I’ll get in there and fix it….
Great! I love it, i tried vcam for as2 and it rocks. but this is even better, now animating and side scrollers will be even easier to make!
super easy and useful, thank you!
Can someone please tell me why i cant use any filter effects , it wont reconise it
Thanks for sharing this idea with us. vCam is really cool.
Man I am so glad I finally found this! I would like to know if I have to use actionscript and coding to make the camera do whatever I need and I also need to know If I have to put it inside of each and every scene. If I want to make it smaller-to-scale, should I use free-transform?
I love you. LOL, this helps soooo much.
Thanks alot!
Works great except for one thing;
I’ts probably just the shit computer I’m sitting at right now, but I’m getting som fpsdrops when I use the vcam(I’m using it in a platform game and sets vCam_mc.x = player_mc.x).
Is there any unnecessary code I can remove if I’m only using the vCam for that or should I change the code that makes it follow the player to something better? I’m new to flash and this is the only way I could think of except moving the vCam when I move the hero, but that felt slower.
Thanks again and thanks again again in advance=)
// Erik
I’m currently trying to make a basic platformer game with two players. The problem is, I don’t know how to use two vcams, and make them follow the mcs’ on two different sections of the screen.
e.g
| First VCAM | Second VCAM |
| | |
| | |
| mc1 mc2|mc1 mc2 |
Can anyone help me?
[...] VCAM. Who said you needed PaperVision3D to have a camera? Might be another addition to my ActionScript toolbox alongside greensock’s Tweenmax… [...]
Sweet, thanks for updating this for AS3, Works fine in CS4 btw, you should add that since its a plus point… unless you did somewhere i didnt see, i dont know i hate reading.
Also, any chance of making this a component instead of a fla file? I think thats the only “problem” with it, not that i am trying to look for a down side. It is still super awesome coolio.
It’s easier for animators to apply filters/color transforms if I leave it as a MovieClip. Filters aren’t available in the properties panel for components.
Hi Brian,
I have a couple of questions. Because of the changes adobe has made to Flash the Quick time exports horribly. I am a timeline animator/instructor and when I export I get all kinds of frame drops. My work around is to export my sound as a qt and export my swf for the visual and take it into After effects put it together and export a great looking QT from there. However I can’t get the vcam to work when I do this. Any suggestions? Should I ask Adam how he exports his stuff?
I hope to continue to work with my community college students with the vcam.
I wish Apple and Adobe would have a cease fire…and fix the flash Quick time.
Thanks Brian,
Pam