Instantiating an embedded bitmap

Ok, I really shouldn’t be having trouble with this, but it has cropped up each time i’ve tried to do this. I have gotten around it in the past but as it keeps cropping up i am obviously not understanding something key here.

I am using the code:


        [Embed(source='ball1.png')]
        private var ball1Image:Class;
        private var ball1:Bitmap = new ball1Image();

It is above the constructor in the main as file if that matters.

and i get this error:

TypeError: Error #1007: Instantiation attempted on a non-constructor.
at main1$iinit()

I just don’t get it. I can remove the brackets after ball1Image and it doesn’t help which i’m sure was how i got around it in the past. What fundamental understanding of as3 am i missing here? It’s beginning to get on my nerves!

I realise this is probably really simple, indulge a wally if you get a chance :slight_smile: