Ok, I have tried to re-write a class from AS2 to AS3, but it didn’t work.
I made a distort class that distorted a bitmap. To do a distort, I needed to pass the x and y properties of 4 draggable points.
To do this, in AS2, I had 4 movieclips on the stage and I just used their x and ys.
Problem 1:
One of the problems with AS3 is that if I tried making a class and linked it through the “Document Class” box, it would return an error because of the movieclips that are already on the stage that are “undefined.”
But I needed to have these MovieClips on the stage because they are my 4 draggable points (and it’s easier than using the “addChild” function)
Problem 2:
I tried going around the problem above by using:
myvar=new MyClass
in the action panel.
but then there were more problems. For my class to work, I need a Bitmap image, which is in the library of my main flash document. I had assigned it a class which extended the BitmapData class.
Now I have 3 classes: TextureManager, Texture and Bmp
(Bmp is the class containing my bitmap)
TextureManager is my main class (the one I wanted to have as my Document Class).
Anyway, TextureManager calls for methods in the Texture class, one of which attempts to create a new “Bmp” image. it should work, but it doesn’t.
It returns an error saying “Variable Bmp is not defined.” I’m so confused. Bmp isn’t even a Variable, It’s a class!!!