Why not use an attribute on each card and the onStart an onComplete
events?

onStart: function(el){
        if(el.get('attrHot')=='HOT'){blah};
    },
    onComplete: function(el){
        el.set('attrHot','COLD');
    }


On Jun 7, 3:36 pm, Trevor Orr <[email protected]> wrote:
> I am writing a Cribbage game in Mootools, I have it pretty much done and
> working in Firefox but have run into an issue in IE.  Here is what is going
> on.
>
> I Deal out the cards to the players.
>
> I get all the cards, loop through them an create a drag.move and use the
> store function and store the drag object in the card like so:
> $$('.PlayingCard').each(function(card) {
> cardDrag = new Drag.Move(card, {
> ....});
>
> card.store('cardDrag', cardDrag);
>
> When it is a players turn I retrieve the stored drag object and use the
> attach method of the drag class like so (
> card.retrieve('cardDrag').attach(); )
>
> When the player completes their turn I use the detach method like so (
> card.retrieve('cardDrag').detach(); )
>
> This allows me to enable and disable dragging cards based upon what the
> current players is, this all works fine in Firefox.  But in IE after the
> first detach() I can no longer retrieve the drag object from the card any
> more.
>
> I built it this way so that players can only drag cards when it is their
> turn.
>
> So I guess my question is does detach destroy the drag object?  Is there a
> better way to handle this type of functionality.
>
> I have not setup anything up in mooshell yet cuase that would take me a
> while to do so but I could if need be.

Reply via email to