Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 23-04-2005, 21:49   #1 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
checkboxes/prototype verbessern

hi, leute!

habe checkbox-prototype erstellt;
erstens:irgendwie funzt das mit dem aktiviert/deaktiviert nicht, wenn ich die checkbox einmal angeklickt habe, dann wieder klicke(deaktiviere), dann kann ich diese nicht mehr anklicken;
zweitens: wie kann man eine dritte viarible einbauen(die "aktiv-abfrager-variable), sodass ich wirklich nur einen prototypen habe? sonst müsste ich für jeden check einen prototype machen(oder eine normale function halt)-so habe ich es momentan auch;

meterlanger code, deswegen ist fla auch mit dabei
ActionScript:
  1. stop();
  2. var anfrage = this;
  3. //----------------------------------------------------header
  4. MC_anfrage.T_welcome.autoSize = "left";
  5. MC_anfrage.T_welcome.selectable = false;
  6. MC_anfrage.T_welcome.text = "Anforderung für ein unverbindliches Kostenangebot Ihres Projektes";
  7. //---------------------------------------------------------scroller
  8. MC_scrollUp.onPress = function() {
  9.     anfrage.MC_anfrage.onEnterFrame = function() {
  10.         this._y += 3;
  11.         if (this._y>=12) {
  12.             this._y = 12;
  13.             delete this.onEnterFrame;
  14.         }
  15.     };
  16. };
  17. MC_scrollUp.onRelease = function() {
  18.     anfrage.MC_anfrage._y = anfrage.MC_anfrage._y;
  19.     delete anfrage.MC_anfrage.onEnterFrame;
  20. };
  21. MC_scrollDown.onPress = function() {
  22.     anfrage.MC_anfrage.onEnterFrame = function() {
  23.         this._y -= 6;
  24.         if (this._y<=-750) {
  25.             this._y = -750;
  26.             delete this.onEnterFrame;
  27.         }
  28.     };
  29. };
  30. MC_scrollDown.onRelease = function() {
  31.     anfrage.MC_anfrage._y = anfrage.MC_anfrage._y;
  32.     delete anfrage.MC_anfrage.onEnterFrame;
  33. };
  34. //------------------------------------------------------mausscroller
  35. mouseListener = new Object();
  36. mouseListener.onMouseWheel = function(delta) {
  37.     MC_anfrage._y += delta*5;
  38. };
  39. Mouse.addListener(mouseListener);
  40. //----------------------------------PROTOTYPE PLANCHECKBOX
  41. _global.alt;
  42. MovieClip.prototype.checkPlan = function(ankreuzen, symbol) {
  43.     if (ankreuzen == true) {
  44.         this.attachMovie(symbol, symbol, 1);
  45.         this.angekreuzt = true;
  46.     } else {
  47.         this.angekreuzt = false;
  48.     }
  49.     this.onPress = function() {
  50.         if (this.angekreuzt == true) {
  51.             this[symbol].removeMovieClip();
  52.             this.angekreuzt = false;
  53.         } else {
  54.             this.attachMovie(symbol, symbol, 1);
  55.             this.angekreuzt = true;
  56.             _global.alt[symbol].removeMovieClip();
  57.             _global.alt = this;
  58.             _global.alt.angekreuzt = false;
  59.         }
  60.     };
  61. };
  62. MC_anfrage.MC_checkPlan1.checkPlan(false, "checkpoint");
  63. MC_anfrage.MC_checkPlan2.checkPlan(false, "checkpoint");
  64. MC_anfrage.MC_checkPlan3.checkPlan(false, "checkpoint");
  65. //----------------------------------PROTOTYPE BILDCHECKBOX
  66. _global.bildalt;
  67. MovieClip.prototype.checkBild = function(ankreuzen, symbol) {
  68.     if (ankreuzen == true) {
  69.         this.attachMovie(symbol, symbol, 1);
  70.         this.angekreuzt = true;
  71.     } else {
  72.         this.angekreuzt = false;
  73.     }
  74.     this.onPress = function() {
  75.         if (this.angekreuzt == true) {
  76.             this[symbol].removeMovieClip();
  77.             this.angekreuzt = false;
  78.         } else {
  79.             this.attachMovie(symbol, symbol, 1);
  80.             this.angekreuzt = true;
  81.             _global.bildalt[symbol].removeMovieClip();
  82.             _global.bildalt = this;
  83.             _global.bildalt.angekreuzt = false;
  84.         }
  85.     };
  86. };
  87. MC_anfrage.MC_checkBild1.checkBild(false, "checkpoint");
  88. MC_anfrage.MC_checkBild2.checkBild(false, "checkpoint");
  89. MC_anfrage.MC_checkBild3.checkBild(false, "checkpoint");
  90. MC_anfrage.MC_checkBild4.checkBild(false, "checkpoint");
  91. //----------------------------------PROTOTYPE AKTIVCHECKBOX
  92. _global.aktivalt;
  93. MovieClip.prototype.checkAktiv = function(ankreuzen, symbol) {
  94.     if (ankreuzen == true) {
  95.         this.attachMovie(symbol, symbol, 1);
  96.         this.angekreuzt = true;
  97.     } else {
  98.         this.angekreuzt = false;
  99.     }
  100.     this.onPress = function() {
  101.         if (this.angekreuzt == true) {
  102.             this[symbol].removeMovieClip();
  103.             this.angekreuzt = false;
  104.         } else {
  105.             this.attachMovie(symbol, symbol, 1);
  106.             this.angekreuzt = true;
  107.             _global.aktivalt[symbol].removeMovieClip();
  108.             _global.aktivalt = this;
  109.             _global.aktivalt.angekreuzt = false;
  110.         }
  111.     };
  112. };
  113. MC_anfrage.MC_checkAktiv1.checkAktiv(false, "checkpoint");
  114. MC_anfrage.MC_checkAktiv2.checkAktiv(false, "checkpoint");
  115. //----------------------------------PROTOTYPE DESIGNCHECKBOX
  116. _global.designalt;
  117. MovieClip.prototype.checkDesign = function(ankreuzen, symbol) {
  118.     if (ankreuzen == true) {
  119.         this.attachMovie(symbol, symbol, 1);
  120.         this.angekreuzt = true;
  121.     } else {
  122.         this.angekreuzt = false;
  123.     }
  124.     this.onPress = function() {
  125.         if (this.angekreuzt == true) {
  126.             this[symbol].removeMovieClip();
  127.             this.angekreuzt = false;
  128.         } else {
  129.             this.attachMovie(symbol, symbol, 1);
  130.             this.angekreuzt = true;
  131.             _global.designalt[symbol].removeMovieClip();
  132.             _global.designalt = this;
  133.             _global.designalt.angekreuzt = false;
  134.         }
  135.     };
  136. };
  137. MC_anfrage.MC_checkDesign1.checkDesign(false, "checkpoint");
  138. MC_anfrage.MC_checkDesign2.checkDesign(false, "checkpoint");
  139. //----------------------------------PROTOTYPE SUCHMASCHINENCHECKBOX
  140. _global.suchalt;
  141. MovieClip.prototype.checkSuch = function(ankreuzen, symbol) {
  142.     if (ankreuzen == true) {
  143.         this.attachMovie(symbol, symbol, 1);
  144.         this.angekreuzt = true;
  145.     } else {
  146.         this.angekreuzt = false;
  147.     }
  148.     this.onPress = function() {
  149.         if (this.angekreuzt == true) {
  150.             this[symbol].removeMovieClip();
  151.             this.angekreuzt = false;
  152.         } else {
  153.             this.attachMovie(symbol, symbol, 1);
  154.             this.angekreuzt = true;
  155.             _global.suchalt[symbol].removeMovieClip();
  156.             _global.suchalt = this;
  157.             _global.suchalt.angekreuzt = false;
  158.         }
  159.     };
  160. };
  161. MC_anfrage.MC_checkSuch1.checkSuch(false, "checkpoint");
  162. MC_anfrage.MC_checkSuch2.checkSuch(false, "checkpoint");
  163. //----------------------------------PROTOTYPE ZEITCHECKBOX
  164. _global.zeitalt;
  165. MovieClip.prototype.checkZeit = function(ankreuzen, symbol) {
  166.     if (ankreuzen == true) {
  167.         this.attachMovie(symbol, symbol, 1);
  168.         this.angekreuzt = true;
  169.     } else {
  170.         this.angekreuzt = false;
  171.     }
  172.     this.onPress = function() {
  173.         if (this.angekreuzt == true) {
  174.             this[symbol].removeMovieClip();
  175.             this.angekreuzt = false;
  176.         } else {
  177.             this.attachMovie(symbol, symbol, 1);
  178.             this.angekreuzt = true;
  179.             _global.zeitalt[symbol].removeMovieClip();
  180.             _global.zeitalt = this;
  181.             _global.zeitalt.angekreuzt = false;
  182.         }
  183.     };
  184. };
  185. MC_anfrage.MC_checkZeit1.checkZeit(false, "checkpoint");
  186. MC_anfrage.MC_checkZeit2.checkZeit(false, "checkpoint");
  187. MC_anfrage.MC_checkZeit3.checkZeit(false, "checkpoint");
  188. //----------------------------------PROTOTYPE INHALTCHECKBOX
  189. _global.inhaltalt;
  190. MovieClip.prototype.checkInhalt = function(ankreuzen, symbol) {
  191.     if (ankreuzen == true) {
  192.         this.attachMovie(symbol, symbol, 1);
  193.         this.angekreuzt = true;
  194.     } else {
  195.         this.angekreuzt = false;
  196.     }
  197.     this.onPress = function() {
  198.         if (this.angekreuzt == true) {
  199.             this[symbol].removeMovieClip();
  200.             this.angekreuzt = false;
  201.         } else {
  202.             this.attachMovie(symbol, symbol, 1);
  203.             this.angekreuzt = true;
  204.             _global.inhaltalt[symbol].removeMovieClip();
  205.             _global.inhaltalt = this;
  206.             _global.inhaltalt.angekreuzt = false;
  207.         }
  208.     };
  209. };
  210. MC_anfrage.MC_checkInhalt1.checkZeit(false, "checkpoint");
  211. MC_anfrage.MC_checkInhalt2.checkZeit(false, "checkpoint");
  212. MC_anfrage.MC_checkInhalt3.checkZeit(false, "checkpoint");
  213. //--------------------------------------------------maskierung
  214. MC_anfrage.setMask(MC_maske);

fla ist dabei
Angehängte Dateien
Dateityp: rar anfrage.rar (9,4 KB, 9x aufgerufen)
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary

Geändert von andretti (23-04-2005 um 21:51 Uhr)
andretti 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 23:04 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele