Yeah, I understand what you want to do. I would make two methods in the
object. One is the animation from state 1 to state 2. Then the second
method to animate from state 2 back to state 1.
Somewhere in the object. Name a property 'toggle' or 'toggled' and
maybe it holds a value of yes/no, true/false, 1/0.
Make a listener for the element for 'click' or 'dblclick'. Switch
statement in the object reads 'this.toggled' to see if it's 'on/off' and
have a simple case statement to handle the toggling.
Case 'on': //animate to the off state
Case 'off': //animate to the on state
Hope that helps. :) I love this stuff but stay mainly quiet. Looks
like lots of foreign folks on there wanting someone to write code for
Give me a yell some time. I'm always working on something.
Software Engineer - Request Systems
From: Tom Jensen [mailto:tomjnsn@...
Sent: Monday, May 01, 2006 4:36 PM
Cc: Gatten, Matt
Thanks Matt for responding. I was thinking along those lines, but I
guess I was wondering at a lower level, should I be creating multiple
Anim objects, one for the highlight and one for the unhighlight, or just
use the same one and reset the to: and from:
attributes depending on the state property. Does that make sense?
--- "Gatten, Matt" <Matt.Gatten@...
> Why not just create one object that contains an off and on state
> property and just do the opposite of whatever it is? Give it a
> 'toggle' method that does it. That's how I do it.
> Matt I
> -----Original Message-----
> From: "tomjnsn" <tomjnsn@yah
> Sent: 5/1/06 2:39:51 PM
> I am wondering if there is a best practice for toggling using the
> stuff? Should I create an object for both directions? Register a
> subscriber for the onComplete event that essentially swaps the to
> from vals?
> Just for clarification: when I say toggling I mean having the
> to call a method that will go in both directions like highlighting
> something when it is clicked on, but then removing the highlight
> it is clicked on again.
> Yahoo! Groups Links
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around