Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 31-05-2004, 18:56   #1 (permalink)
Grillmeister
 
Benutzerbild von Schaschlick
 
Registriert seit: Jul 2003
Ort: Stuttgart
Beiträge: 188
Kästchenlandschaft

hab mir eigentlich eine kästchenlandschaft vorgestellt, bei rollout,..., ein fadeeffekt passieren soll, aber es klappt nich so wie ich will, wäre nett, wenn jmd was dazu sagen könnte:

ActionScript:
  1. createEmptyMovieClip("box", 0);
  2. with (this.box) {
  3.     beginFill(0x003366, 100);
  4.     moveTo(25, 15);
  5.     lineTo(40, 15);
  6.     lineTo(40, 30);
  7.     lineTo(25, 30);
  8.     lineTo(25, 15);
  9.     endFill();
  10. }
  11. box._x = 0;
  12. box._y = 0;
  13. box._alpha = 30;
  14. // anzahl dublizierungen in der X achse
  15. mapX = 40;
  16. // anzahl Dublizierungen in der Y achse
  17. mapY = 2;
  18. // Breite des MC
  19. w = 30;
  20. // Höhe des MC
  21. h = 15;
  22. // X position des ersten MC
  23. xPos = 15;
  24. // Y position des ersten MC
  25. yPos = 0;
  26. for (var x = 0; x<mapX; x++) {
  27.     for (var y = 0; y<mapY; y++) {
  28.         n++;
  29.         duplicateMovieClip(_root.box, "box"+n, n);
  30.         _root["box"+n]._x = xPos+(x)*w/2;
  31.         _root["box"+n]._y = yPos+(y)*h;
  32.         _root["box_"+n]._alpha = 30;
  33.         _root["box_"+n].onRollOver = function() {
  34.             this.onEnterFrame = function() {
  35.                 if (this._alpha<50) {
  36.                     this._alpha += 20;
  37.                 } else {
  38.                     delete this.onEnterFrame;
  39.                 }
  40.             };
  41.         };
  42.         _root["box_"+n].onRollOut = function() {
  43.             this.onEnterFrame = function() {
  44.                 if (this._alpha>30) {
  45.                     this._alpha -= 3;
  46.                 } else {
  47.                     this._alpha = 30;
  48.                     delete this.onEnterFrame;
  49.                 }
  50.             };
  51.         };
  52.     }
  53. }
__________________
Der Schwabe an sich kann alles nur KEIN Hochdeutsch
Schaschlick ist offline   Mit Zitat antworten
Alt 31-05-2004, 18:59   #2 (permalink)
Grillmeister
 
Benutzerbild von Schaschlick
 
Registriert seit: Jul 2003
Ort: Stuttgart
Beiträge: 188
nein nein, wie doof bin ich, ich hab mir soeben selbst geholfen!!
ActionScript:
  1. .
  2. .
  3. _root["box"+n].onRollOver = function() {
  4. .
  5. .
  6. _root["box"+n].onRollOut = function() {

so is es richtig, wem es nich aufgefallen is, anstatt ..["box_"]... -> ["box"]!!! ich weiß au nich wie mir des unterlaufen is!!!
__________________
Der Schwabe an sich kann alles nur KEIN Hochdeutsch
Schaschlick ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an



Alle Zeitangaben in WEZ +1. Es ist jetzt 17:35 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele