Get Adobe Flash player

AS3 DragObject – Dynamic Animation via Destination

I’ve been using this DragObject class for a while now. It was just a quick little MovieClip extension I threw together to give any MovieClip I had a destination x and y to automatically animate to. Simply explained, when the destination x and y are changed, the onEnterFrame function makes sure the clip animates to it. Since putting it together, I’ve been very fond of this sort of tweening concept. It allows for dynamic changing of properties without needing to worry about mid-animation changes; with only 1 property determining the destination value, your MovieClip will never get confused or lost as to which way it should be going.

One thing to note is that on the timeline I have set up a globalMouseUp function. This is necessary for implementation of the DragObject if your cursor is able to leave the object when dragging it.

Also added in some fun proximity checking. Source and Enjoy.

-Andrew

Tags: , , , , , , , ,

One Response to “AS3 DragObject – Dynamic Animation via Destination”

  1. EVAN says:


    Medicamentspot.com. Canadian Health&Care.Special Internet Prices.Best quality drugs.No prescription online pharmacy. High quality drugs. Buy drugs online

    Buy:Viagra Soft Tabs.Cialis Soft Tabs.Viagra Super Active+.Propecia.Levitra.Maxaman.Tramadol.Viagra Super Force.VPXL.Cialis Super Active+.Soma.Viagra Professional.Viagra.Super Active ED Pack.Cialis.Zithromax.Cialis Professional….

Leave a Reply