It's not really good paractice to name classes with Obj in the title, but anyway:

class lizPieceObj {

   public var levelup:MovieClip;
   public varlizPieceMC:MovieClip;
   public varmasker:MovieClip;
   public varlevelMasker:MovieClip;

   public function lizPieceObj(levelup:MovieClip, lizPieceMc:MovieClip,
masker:MovieClip, levelMasker:MovieClip) {
        // build an obj to mimick 2d array.
        this.levelup = levelup;
        this.lizPieceMC = lizPieceMC;
        this.masker = masker;
          this.levelMasker = levelMasker;
    }
}

I haven't checked it. You mention a class variable in your description, I'm not sure if you really mean a property (instance variable) or a class property (static variable), or if your constructor is intentionally private.

Paul

----- Original Message ----- From: "ilteris kaplan" <[EMAIL PROTECTED]>
To: "Flash Lists" <[email protected]>
Sent: Thursday, July 26, 2007 8:18 PM
Subject: [Flashcoders] object Arrays


Hello All,

Basically I am trying to create a object which I can pass to my array and then access some properties of this object. Only problem is, I am trying to achieve this in a class.

Basically I declared my array as a class variable and then instantiated it in my constructor function in the class. I do have this function which is supposedly to create an object with certain properties.




private function lizPieceObj(levelup:MovieClip, lizPieceMc:MovieClip, masker:MovieClip, levelMasker:MovieClip) {
// build an obj to mimick 2d array.

this.levelup = levelup;
this.lizPieceMC = lizPieceMC;
this.masker = masker;
this.levelMasker = levelMasker;
}


Here is, in another function, I am trying to create this object.
piecesArray[index] = new lizPieceObj(levelup, lizPieceMc, masker, levelMasker);

in order to access them later like
piecesArray[index].levelup, piecesArray[index].masker etc.

But upon compilingthe code, I do get this error. There is no property with the name levelup. There is no property with the name lizPiece, There is no property with the name masker.... etc.

you get the idea.
I am assuming this is something to do with scope. I am yet not sure how to deal with it though.
Thanks a lot.



_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to