Drag and Drop Tutorial in Flash Actionscript 3 (Part 3 of 3)
Uploader Comments (DNDigital)
Video Responses
All Comments (59)
-
Thak you so much!
-
@swissrudiment I'll try to help you along. In DraggableShirt, just above the other 'protected var', put 'protected static var dropCount:uint = 0;'. The 'static' keyword means that this variable belongs to the class, rather than an instance, so it is shared between all the white/black/whatever t-shirts you might have. In the droptarget if-statement, you can increase the dropCount (dropCount++;) and use it for positioning (ie. x = dropCount * 10;). Hope that helps, enjoy and happy coding!
-
@DNDigital So I experimented with your Math series tutorial-Positioning and Centering (another great tut)- to get a better grip on object x, y placement. However, my novice skills keep me from constructing a code for tracking of other dropped items via a protected (or public) static variable. If you have or could suggest a resource that would help I'd be happy to see it. Otherwise I'm willing to pay for the expertise. Having great fun seeing my ideas come alive! Thanks
-
@swissrudiment In the droptarget if-statement you can adjust the x position of the dropped clips and use width and height for relative alignment. The y-position calc does something similar already. If you wanted you could keep track of other dropped items via a protected (or public) static variable in the DraggableShirt class - this would be shared with all draggable instances and hence you could account for previously dropped items when calculating the position. The world is your oyster...
-
@swissrudiment Many thanks for your kind comments - I'm glad it's been useful to you! You might have tried it already but if not, switching the video quality to 720p should hopefully make even the punctuation legible. Enjoy coding and welcome to AS3!
-
1 more thing...how can I manipulate the placement of the dropped items at the bottom of the screen. My inteaction has students dropping lab report icons into a folder. Ideally, I'd like them to line up in a row along the bottom of the stage with an slight overlap (the alpha overlap adds a cool effect) or no overlap( edge to edge) would also be fine. Thanks again!!
I dont generally reply to videos on YouTube, but i just wanted to thank you for the effort and time you put into making this video, this is just what i was looking for and has helped me more than you can imagine! Thank you so much!
Choshy 1 month ago
@Choshy Hi Choshy - I'm glad you took the time, it's always great to receive feedback - especially of the positive kind. Glad it helped you and keep coding!
DNDigital 1 month ago
OMG dude I loved your drag and drop videos amazing work
I was searching a lot of videos for something like this and yours was by far the best
GhostRyley 1 month ago
@GhostRyley Hi GhostRyley - congratulations on the first comment in 2012 and Happy New Year! Thanks for the positive response and happy coding!
DNDigital 1 month ago