Home Contact RSS

Men Circles | Interactive Experiment

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Here’s a graphic of a circle of men. You may recognize the outline from any public restroom. They’re standing in a corny circle holding hands, like an all over the world theme., let’s just hope they all washed their hands…

I made the graphic a while ago, and have been wanting to interactive-ize it. I’ve really been wanting to play with elasticity, throwing things and snapping to a point… Although I’m still thinking about a version where I’d spin the objects rather than just throw them, I figured I’d put it up for any feedback that comes.

(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)

The different pieces all rotate differently and it changes if you are dragging or ‘holding’ them. Then you can press the anchor (gray) button to toggle the snap. The objects will all center around the anchor and spring into place (elasticity applied to position and rotation). And then the interactivity changes and rather than dragging and dropping them, you push and bump or throw them. It almost turns into a game…

Here’s some of the actionscript

  1. _root.tr = 0;
  2. _root.k = 0.2;
  3. _root.damp = .9;
  4. _root.margin = 150;
  5. _root.heads.ax = 0;
  6. _root.heads.vx = 0;
  7. _root.heads.ay = 0;
  8. _root.heads.vy = 0;
  9. _root.heads.ar = 0;
  10. _root.heads.vr = 0;
  11. _root.heads._x = (Math.random() * (Stage.width + _root.heads._width)) - _root.margin;
  12. _root.heads._y = (Math.random() * (Stage.height + _root.heads._height)) - _root.margin;
  13.  
  14. //Heads
  15. _root.heads.dragging = false;
  16. _root.heads.onEnterFrame = function() {
  17. if (!_root.center.dragging){
  18. if (_root.heads.dragging){
  19. this._rotation += 1.2;
  20. }
  21. else {
  22. rot = this._rotation + Math.random();
  23. xmouse = _root._xmouse/Stage.width;
  24. this._rotation += rot + xmouse;
  25. }
  26.  
  27. this._x+=Math.random()*2 - 1;
  28. this._y+=Math.random()*2 - 1;
  29.  
  30. }
  31. else {
  32. //_root.heads._x = _root.center._x;
  33. //_root.heads._y = _root.center._y;
  34. _root.heads.ax = (_root.center._x - _root.heads._x) * _root.k;
  35. _root.heads.vx += _root.heads.ax;
  36. _root.heads.vx *= _root.damp;
  37. _root.heads._x += _root.heads.vx;
  38.  
  39. _root.heads.ay = (_root.center._y - _root.heads._y) * _root.k;
  40. _root.heads.vy += _root.heads.ay;
  41. _root.heads.vy *= _root.damp;
  42. _root.heads._y += _root.heads.vy;
  43.  
  44. _root.heads.ar = (_root.tr - _root.heads._rotation) * _root.k;
  45. _root.heads.vr += _root.heads.ar;
  46. _root.heads.vr *= _root.damp;
  47. _root.heads._rotation+=_root.heads.vr;
  48. }
  49. this.onPress = function() {
  50. startDrag(this, false);
  51. _root.heads.dragging = true;
  52. }
  53. this.onRelease = this.onReleaseOutside = function() {
  54. stopDrag();
  55. _root.heads.dragging = false;
  56. }
  57. this.onRollOver = function() {
  58. if(_root.center.dragging){
  59. startDrag(this, false);
  60. _root.heads.dragging = true;
  61. }
  62. }
  63. this.onRollOut = function() {
  64. if(_root.center.dragging) {
  65. stopDrag();
  66. _root.heads.dragging = false;
  67. }
  68. }
  69. }
  70.  
  71. //Button
  72. _root.center.dragging = false;
  73. _root.center.onEnterFrame = function() {
  74. this.onPress = function() {
  75. startDrag(_root.center, false);
  76. _root.center.dragging = !_root.center.dragging;
  77. if (_root.center.dragging) {
  78. this.gotoAndStop("on");
  79. }
  80. else {
  81. this.gotoAndStop("off");
  82. }
  83.  
  84. //var vr:Number = 0;
  85. }
  86. this.onRelease = this.onReleaseOutside = function () {
  87. stopDrag();
  88. //_root.center.dragging = false;
  89. }
  90. }

Tags: , , , , , ,

Related posts

flashden banner

Leave a Comment