ignore this. turns out it was a really stupid question.
i if i call the function as something(this) and the function is
declared as something(compInst) then i can reference the component's
properties and such (from within the function) simply as
compInst.property.
derrrrrrr
On 5/12/05, grant <[EMAIL PROTECTED]> wrote:
> hi
>
> (apologies, i've also posted this to fugli, but it seems there are
> more MM alcolytes in here than there)
>
> i've got a few components that share the same functions. i pass the
> component name into the function and have been using if/else with
> hardcoded instancenames within the function.
>
> is there a best practice way of referring to the components dynamically?
>
> currently i'm kinda doing this:
>
> function something(componentInstanceName) {
> if (componentInstanceName == "widget1") {
> this.widget1.text = "something";
> }
> else if (componentInstanceName == "widget2") {
> this.widget2.text = "something";
> }
> }
>
> and i'd like to:
>
> function something(componentInstanceName) {
> this.stageObjectOrSomeCollection[componentInstanceName].text =
> "something";
> }
>
> is there a decent way of doing this?
>
> ---
> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to [EMAIL PROTECTED]
> Aussie Macromedia Developers: http://lists.daemon.com.au/
>
---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/