Hiya… Im trying out some basic OOP… and cannot understand where I am going wrong. It works within the timeline - but when I transfer to Packages It doesnt work where concerning the property of the bitmap.
I have a ‘MyClip’ instance in the library.
here is my bask Document Class package::
package {
import flash.display.*;
import flash.events.*;
public class MyMain extends MovieClip
{
public var pic:MyClip = new MyClip();
public function MyMain():void
{
Render();
}
public function Render()
{
this['bmp'] = new BitmapData(stage.stageWidth,stage.stageHeight,true,0x000000);
this['bmp'].draw( pic );
this['item'] = new Bitmap( this['bmp'] );
this.addChild( this['item'] );
}
}
}
the this[‘bmp’] is to be used with this[‘bmp’+i] to make multiple instances within a loop … and Ive seen that method used before. IF I take out the this[‘bmp’] and replace with var bmp = new… etc - then it works. Hmm
can anyone guide me home?
Thanks!