Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 03-04-2004, 10:28   #1 (permalink)
Flash & TYPO3
 
Registriert seit: Oct 2003
Ort: Bayern
Beiträge: 2.700
Klcikstatus will nicht!

Hallo,

wieso funktioniert der Klickstatus nicht? Wenn der Button geklickt wurde, sollte dieser diagonale Strich nicht mehr verschwinden!?!?

ActionScript:
  1. // ------------- Erstellt die Buttons --------------------- //
  2. makeBtns = function(nr) {
  3.     //oldNr = nr;
  4.     reihenanzahl = 15;
  5.     for(i=0; i<nr; i++) {
  6.         _root.createEmptyMovieClip("viereck" + i, i);
  7.         with (_root["viereck" + i]) {
  8.             beginFill (0x000000, 30);
  9.             lineStyle (1, 0x000000, 90);
  10.             moveTo (0, 0);
  11.             lineTo (0, 10);
  12.             lineTo (10, 10);
  13.             lineTo (10, 0);
  14.             endFill();
  15.             setMouseEffekt();
  16.             if(i < reihenanzahl) {
  17.                 _y = 10;
  18.                 _x = i * 20;               
  19.             } else {
  20.                 _x = (i - reihenanzahl) * 20;
  21.                 _y = 30;
  22.             }
  23.            
  24.         }
  25.        
  26.     }
  27. };
  28.  
  29.  
  30. MovieClip.prototype.setMouseEffekt = function() {
  31.     this.onRollOver = function() {
  32.         this._alpha = 50;
  33.         this.createEmptyMovieClip(this._name + "_over", depth+600);
  34.         with(this[this._name + "_over"]) {
  35.             trace(_name);
  36.             lineStyle (1, 0x000000, 100);
  37.             moveTo(0,00);
  38.             lineTo(10,10);
  39.         }
  40.     }
  41.  
  42.     this.onRollOut = function() {
  43.         this._alpha = 100;
  44.         if(this.clicked != "true") {
  45.             trace(this.clicked);
  46.             this[this._name + "_over"].removeMovieClip();
  47.         } else {trace(this.clicked);}
  48.     }
  49.  
  50.     this.onPress = function() {
  51.         this.clicked = true;
  52.     }
  53. }
  54.  
  55.  
  56. makeBtns(25); // Bezieht die Infos auf einer XML
  57.  
__________________
Mediendesign-Student

Geändert von johanness (03-04-2004 um 10:29 Uhr)
johanness ist offline   Mit Zitat antworten
Alt 03-04-2004, 11:57   #2 (permalink)
Flash & TYPO3
 
Registriert seit: Oct 2003
Ort: Bayern
Beiträge: 2.700
so. auch selbst gelöst
Die Anführungszeichen waren der Schlüssel:
ActionScript:
  1. btnArr = new Array();
  2.  
  3. galData = new XML();
  4. galData.ignoreWhite = true;
  5. galData.onLoad = function(success) {
  6.     if(success) {
  7.         trace("Erfolgreich die XML-DatenBank geladen!");
  8.        
  9.         makeBtns(galData.firstChild.childNodes[0].attributes.fotonumber);
  10.        
  11.     } else {
  12.         trace("Fehler beim Verbinden zur XML-Datenbank!");
  13.     }
  14. };
  15. galData.load("gallery/galData.xml");
  16.  
  17.  
  18. // ------------- Erstellt die Buttons --------------------- //
  19. makeBtns = function(nr) {
  20.     //oldNr = nr;
  21.     reihenanzahl = 15;
  22.     for(i=0; i<nr; i++) {
  23.         _root.createEmptyMovieClip("viereck" + i, i);
  24.         with (_root["viereck" + i]) {
  25.             beginFill (0x000000, 30);
  26.             lineStyle (1, 0x000000, 90);
  27.             moveTo (0, 0);
  28.             lineTo (0, 10);
  29.             lineTo (10, 10);
  30.             lineTo (10, 0);
  31.             endFill();
  32.             setMouseEffekt();
  33.             if(i < reihenanzahl) {
  34.                 _y = 10;
  35.                 _x = i * 20;               
  36.             } else {
  37.                 _x = (i - reihenanzahl) * 20;
  38.                 _y = 30;
  39.             }
  40.            
  41.         }
  42.        
  43.     }
  44. };
  45.  
  46.  
  47. MovieClip.prototype.setMouseEffekt = function() {
  48.  
  49.     this.onRollOver = function() {
  50.         this._alpha = 50;
  51.         this.createEmptyMovieClip(this._name + "_over", depth+600);
  52.         with(this[this._name + "_over"]) {
  53.             trace(_name);
  54.             lineStyle (1, 0x000000, 100);
  55.             moveTo(0,00);
  56.             lineTo(10,10);
  57.         }
  58.     }
  59.  
  60.     this.onRollOut = function() {
  61.         this._alpha = 100;
  62.         if(this.clicked != true) {
  63.             this[this._name + "_over"].removeMovieClip(); // Wenn noch nicht geklickt, entferne Diagonale
  64.         }
  65.     }
  66.  
  67.     this.onPress = function() {
  68.         this.clicked = true;
  69.     }
  70. }
__________________
Mediendesign-Student
johanness 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 18:29 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele