Hi,
i don't think that's possible. Why don't you encapsulate the label in a
Javascript object, and you'll be able to define any function you want for
it.

Thanks,
Teo

On Thu, Sep 18, 2008 at 11:45 AM, Steve Simitzis <[EMAIL PROTECTED]> wrote:

>
> Hello -
>
> I would like to add a method to one of the element classes. Is this
> possible?
>
> So let's say I have -
>
> <label name="chickens" x="5" />
>
> And let's say for example, I would like to do this in my code:
>
> var x = chickens.getX();
>
> Ideally I would do that by adding a function like this:
>
> label.prototype.getX = function() { return this.x; }
>
> (Of course, this is a lame example, since there's no reason to write a
> function just to return the value of x. But there are reasons you
> might want to define a new method.)
>
> Now when I actually try it, I get an error that label.prototype is
> undefined. So clearly I'm missing something. Either there's no way to
> modify an element class, or it's named something other than "label".
>
> thanks!
> >
>


-- 
Teo (a.k.a. Teodor Filimon, Teominator)
Site - www.teodorfilimon.com | Blog - www.teodorfilimon.blogspot.com
GMT +2 (or PDT +10)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Desktop Developer Group" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Desktop-Developer?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to