You may have noticed that the Damn function Follow can ONLY be used in the movie clip actionscript panel. Well this is a solution!
Here is an entirely new Cam Class
Instructions for usage are inside the file, but the basic basic basics are that the only lines you need to put to create a VCam in Flash AS2 are:
inside of the movieclip:
var CM = new VCam()
in the main actions panel:
var C = cam.CM
onEnterFrame = function(){
C.Follow(cam,char)
}
5 lines, 5 lines instead of a whole shitload of confusing code that is annoying to have to copy/paste every time you need a VCam
Assuming you gave instance names, the camera is 'cam' and the character to follow is 'char'
All script goes inside frames
There are three variables used in the class that can be changed outside of it, allowing intricate things to happen, they are:
Floor, Mouse, and Visible
Floor makes the camera follow the object riding the bottom of the movie, rather than being centered
Mouse makes the camera Follow the mouse
Visible decides whether or not the camera is visible, this one is different, however.
To use Visible, place
VCam.Visible = true
CM = new VCam(this)
These two lines need to be arranged exactly like that, or it won't work
I have no idea why :/
New edit:
You can include ALL the script in the main frame!
Just put:
onEnterFrame = function(){
CAM = new VCam(instance1)
CAM.Follow(instance1,instance2)
}
TheAnt
great stuff, thanks
B1KMusic
fo' sho