Forum Topic: V-cam In As2

(91 views • 3 replies)

New Topic Post Reply

This topic is 1 page long.

<< < > >>
None

Akunu

Reply to Post Reply & Quote

Posted at: 6/29/09 06:38 PM

Akunu NEUTRAL LEVEL 07

Sign-Up: 01/03/09

Posts: 20

I've been playing arround with the script for a vcam in as2 for a while and heres what I have:
function camControl():Void {
parentColor.setTransform(camColor.getTra nsform());
var scaleX:Number = sX/this._width;
var scaleY:Number = sY/this._height;
_parent._x = cX-(this._x*scaleX);
_parent._y = cY-(this._y*scaleY);
_parent._xscale = 100*scaleX;
_parent._yscale = 100*scaleY;
}
function resetStage():Void {
var resetTrans:Object = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
parentColor.setTransform(resetTrans);
_parent._xscale = 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
}
// make frame invisible
this._visible = false;
// Capture stage parameters
var oldMode:String = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX:Number = Stage.width/2;
var cY:Number = Stage.height/2;
var sX:Number = Stage.width;
var sY:Number = Stage.height;
Stage.scaleMode = oldMode;
// create color instances for color
// transforms (if any).
var camColor:Color = new Color(this);
var parentColor:Color = new Color(_parent);
// Make the stage move so that the
// v-cam is centered on the
// viewport every frame
this.onEnterFrame = camControl;
// Make an explicit call to the camControl
// function to make sure it also runs on the
// first frame.
camControl();
// If the v-cam is ever removed (unloaded)
// the stage, return the stage to the default
// settings.
this.onUnload = resetStage;

BBS Signature

None

Woadraiders

Reply to Post Reply & Quote

Posted at: 6/29/09 07:29 PM

Woadraiders DARK LEVEL 11

Sign-Up: 11/11/07

Posts: 561

http://www.oreillynet.com/pub/a/javascri pt/2004/08/17/flashhacks.html?page=last&
x-showcontent=text

Don't EVER claim someone elses work as your own. Even the comments are identical

Mibbygames.com
panterA

BBS Signature

None

Chaz

Reply to Post Reply & Quote

Posted at: 6/29/09 08:25 PM

Chaz NEUTRAL LEVEL 22

Sign-Up: 09/27/05

Posts: 4,324

At 6/29/09 06:38 PM, Akunu wrote: I've been playing arround with the script for a vcam in as2 for a while and heres what I have:

I'm not sure what your point is?


None

Akunu

Reply to Post Reply & Quote

Posted at: 7/1/09 12:06 AM

Akunu NEUTRAL LEVEL 07

Sign-Up: 01/03/09

Posts: 20

At 6/29/09 07:29 PM, Woadraiders wrote: http://www.oreillynet.com/pub/a/javascri pt/2004/08/17/flashhacks.html?page=last&
x-showcontent=text

Don't EVER claim someone elses work as your own. Even the comments are identical

OK then, let me refrase:
I found this on a website; thought it might be useful. HAPPY NOW!!!???

BBS Signature

All times are Eastern Standard Time (GMT -5) | Current Time: 08:24 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!