Ok.

The only thing I can think of is to have an array like this:

private var properties:Array = ["prop1", "prop2", "prop3", etc];

and check according to that.

It's not very easy to maintain and not so clean probably, but it works.
You probably have thought of this anyway.

Regards,
Dimitrios

----- Original Message ----- From: "Janis Radins" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <flashcoders@chattyfig.figleaf.com>
Sent: Wednesday, November 30, 2005 3:50 PM
Subject: Re: [Flashcoders] lil OOP question


Explination to why I need this is very simple.
The actual class I have looks like this:

class foo {
function foo(initObject:Object){
for(var i:String in initObject){
if(setter named same as i exists){
this[i] = initObject[i];
} else {
trace("error, invalid value in initObject")
}
}
}
}

As I allready said I have alternative solution so this is what I
expected and doesnt make any problem.

Thankyou for response.

2005/11/30, Dimitrios Bendilas <[EMAIL PROTECTED]>:
Hi Janis,

As far as I can see from the class declaration,
this is not a dynamic class.

So, why would you want to check if a property is "declared"?
You are the one who sets the declared variables inside the class.

Is there something I'm not getting?

Dimitrios

----- Original Message -----
From: "Janis Radins" <[EMAIL PROTECTED]>
To: <Flashcoders@chattyfig.figleaf.com>
Sent: Wednesday, November 30, 2005 3:24 PM
Subject: [Flashcoders] lil OOP question


hey ppl

I'm wondering is there a way to chech wether some class function
exists from constructor?
smthn like:
class foo {
function foo(){
if(this class has property named fooProperty) dothis()
else doThat()
}
public function set fooProperty (smthn):Void {
someFooProperty = smth;
}
}

As far as I've tried it this["fooProperty"] returns only undefined.

I know more than one possible workaround, just this way seems to me
more elegant.

Tnx in advance.

Janis
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to