Skip to content

Instantly share code, notes, and snippets.

@PatoFlamejanteTV
Created September 13, 2025 21:44
Show Gist options
  • Select an option

  • Save PatoFlamejanteTV/2cab0acf03754f6feca176c08b559215 to your computer and use it in GitHub Desktop.

Select an option

Save PatoFlamejanteTV/2cab0acf03754f6feca176c08b559215 to your computer and use it in GitHub Desktop.
Adobe Flash custom VCam script, modded from Virtual Camera CS for Adobe Flash CS3 © by FlasH-lee. Please credit if you use it. Made by me.
// QCam.as -=-=- By UltimateQuack (aka. PatoFlamejanteTV/PatoEmChamas)
// Adobe Flash custom VCam script
// modded from Virtual Camera CS for Adobe Flash CS3 © by FlasH-lee.
// Please credit if you use it
// from original code (c) 2006-2007 by Sockpuppet Pty Ltd
// Virtual Camera CS for Adobe Flash CS3 © by FlasH-lee
import flash.geom.Matrix;
import flash.geom.ColorTransform;
var curCam:Transform = new flash.geom.Transform(this);
var camera:Transform = new flash.geom.Transform(this.parent);
var w:int = stage.stageWidth;
var h:int = stage.stageHeight;
this.visible = false;
// smoothing factor (lower = smoother, higher = snappier)
var smooth:Number = 0.12;
// keep working copies
var camMatrix:Matrix = new Matrix();
var camCT:ColorTransform = new ColorTransform();
function doCam(event:Event):void {
this.parent.filters = this.filters;
// --- MATRIX ---
// target camera transform
var targetMatrix:Matrix = curCam.matrix.clone();
targetMatrix.invert();
targetMatrix.translate(w * 0.5, h * 0.5);
// smooth all matrix components
camMatrix.a += (targetMatrix.a - camMatrix.a) * smooth;
camMatrix.b += (targetMatrix.b - camMatrix.b) * smooth;
camMatrix.c += (targetMatrix.c - camMatrix.c) * smooth;
camMatrix.d += (targetMatrix.d - camMatrix.d) * smooth;
camMatrix.tx += (targetMatrix.tx - camMatrix.tx) * smooth;
camMatrix.ty += (targetMatrix.ty - camMatrix.ty) * smooth;
camera.matrix = camMatrix;
// --- COLOR TRANSFORM ---
var targetCT:ColorTransform = curCam.colorTransform;
camCT.redMultiplier += (targetCT.redMultiplier - camCT.redMultiplier) * smooth;
camCT.greenMultiplier += (targetCT.greenMultiplier - camCT.greenMultiplier) * smooth;
camCT.blueMultiplier += (targetCT.blueMultiplier - camCT.blueMultiplier) * smooth;
camCT.alphaMultiplier += (targetCT.alphaMultiplier - camCT.alphaMultiplier) * smooth;
camCT.redOffset += (targetCT.redOffset - camCT.redOffset) * smooth;
camCT.greenOffset += (targetCT.greenOffset - camCT.greenOffset) * smooth;
camCT.blueOffset += (targetCT.blueOffset - camCT.blueOffset) * smooth;
camCT.alphaOffset += (targetCT.alphaOffset - camCT.alphaOffset) * smooth;
camera.colorTransform = camCT;
}
addEventListener(Event.ENTER_FRAME, doCam);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment