. .
CREATE OR DIE Special Downloads Shop webinale

Schauplatz

CodeSnippets

MovieClip.setze3D Menue - Pseudo 3D-Rotationsmenü

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Verwendung

Sie wollten schon immer mal ein Rotationsmenü mit Tiefenwechsel realisieren, um dieses in Ihre Flash-Produktionen zu platzieren?
Dann dürfte die setze3DMenue()-Methode genau das Richtige für Sie sein. Der erste Parameter pIcon legt den als Partikel vorgesehenen Verknüpfungsbezeichner des auf die Bühne zu projizierenden Movieclips fest. Die Parameter posX und posY legen die Position der zu rotierenden Movieclip-Instanzen fest und über den Parameter pMenueliste können Sie ein beliebiges Array mit den enthaltenen Menüeinträgen übergeben.

Code - Flash MX bis Flash 8
  1. MovieClip.prototype.setze3DMenue = function (pIcon, posX, posY, pMenueliste)
  2. {
  3. this.mausPos = 0;
  4. this.winkel = 0;
  5. _global.signal = true;
  6. this.anzahl = pMenueliste.length - 1;
  7. for (var i = 1; i < this.anzahl + 1; i++)
  8. {
  9. this.attachMovie (pIcon, "clip" + i, i);
  10. }
  11. this.onEnterFrame = function ()
  12. {
  13. if (signal)
  14. {
  15. this.mausPos += ((this._xmouse - posX) / 100);
  16. for (var i = 1; i < this.anzahl + 1; i++)
  17. {
  18. this.winkel = ((this.mausPos + (360 / this.anzahl * i)) * Math.PI) / 180;
  19. this["clip" + i]._x = posX + (Math.sin (-this.winkel) * 300);
  20. this["clip" + i]._y = posY + (Math.cos (-this.winkel) * 50);
  21. this["clip" + i]._xscale = 100 + (Math.cos (this.winkel) * 50);
  22. this["clip" + i]._yscale = 100 + (Math.cos (this.winkel) * 50);
  23. this["clip" + i].swapDepths (1000 + (Math.cos (this.winkel) * 100));
  24. this["clip" + i].txtName = pMenueliste[i][1].toUpperCase ();
  25. this["clip" + i].url = pMenueliste[i][0];
  26. this["clip" + i].onRelease = function ()
  27. {
  28. getURL (this.url, "_target");
  29. signal = false;
  30. };
  31. this["clip" + i].onRollOver = function ()
  32. {
  33. signal = false;
  34. };
  35. this["clip" + i].onRollOut = function ()
  36. {
  37. signal = true;
  38. };
  39. }
  40. }
  41. };
  42. };
  43. ASSetPropFlags (MovieClip.prototype, "setze3DMenue", 1);
Anwendung
  1. links = new Array ();
  2. links[1] = ["http://www.flashstar.de", "Flashstar"];
  3. links[2] = ["http://www.flashangel.de", "Flashangel"];
  4. links[3] = ["http://www.flashpower.de", "Flashpower"];
  5. links[4] = ["http://www.multimedia.de", "Multimedia"];
  6. links[5] = ["http://www.flashforum.de", "Flashforum"];
  7. links[6] = ["http://www.flashmx.de", "FlashMX"];
  8. links[7] = ["http://www.flashtalk.at", "FlashTalk"];
  9. this.setze3DMenue ("clip", Stage.width/2, Stage.height/2, links);

Caroline und Matthias Kannengiesser

Tags
    keine Tags
Kommentare
Bisher keine Kommentare