Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 08-10-2003, 13:55   #1 (permalink)
Neuer User
 
Registriert seit: Aug 2003
Ort: Bamberg
Beiträge: 876
Question onRollover zufalls alpha???? achtung kompliziert!!!

halli hallo also ich hab mal eine frage ich fang jetzt erst an as zu lernen ... hab die letzte zeit immer nur goto stop play etc genutzt...
also ich habe ein bild als hintergrund nun hab ich einen Mc wenn man darüberrollt soll er durchsichtiger werden (er ist schon ca auf 80-70 % alpha) nun soll aber bei jedem mal rüberrollen einen andren alpha wert haben ...nun ja und noch etwas letztes... er soll nicht von 80 auf 70 mit einem mal gehen sondern langsam runtergehen... oder auch hoch gehen denn es soll ja der wert der beim letzten rollover am schluß angezeigt wurde beibehalten werden ich weiß es ist sehr anspruchsvoll ich glaub auch nicht das sich jemand sich die mühe macht und ihn schreiben willst aber ein paar tips wären suuper =)
viele liebe grüße ,

Geändert von wangman (08-10-2003 um 14:15 Uhr)
wangman ist offline   Mit Zitat antworten
Alt 08-10-2003, 14:31   #2 (permalink)
Genius
 
Benutzerbild von f@gju
 
Registriert seit: Sep 2003
Ort: Banned into Jail
Beiträge: 650
machst einfach sone funktion bei roll over

ActionScript:
  1. intID = setInterval(fadein, 50);
  2.         var endwert = 20+Math.ceil((Math.random()*50));
  3.         function fadein(){
  4.             if(this._alpha > endwert){
  5.                 this._alpha -= 2;
  6.             }else{
  7.                 clearInterval(intID);
  8.             }
  9.         }
__________________
Klick hier
f@gju ist offline   Mit Zitat antworten
Alt 08-10-2003, 16:29   #3 (permalink)
Neuer User
 
Registriert seit: Aug 2003
Ort: Bamberg
Beiträge: 876
halli hallo
danke für die antwort aber wie gesagt ich kenn mich noch nicht wirklich aus und wie das mit deinem as gehen soll blick ich nicht ganz aber trozdem danke =) es können ruhig noch mehr antworten =))))
wangman ist offline   Mit Zitat antworten
Alt 09-10-2003, 08:37   #4 (permalink)
Genius
 
Benutzerbild von f@gju
 
Registriert seit: Sep 2003
Ort: Banned into Jail
Beiträge: 650
hmmm sry abba wennich abreit feddich habe guggich das ff nich mehr an

ich bastle ma wat fürs verständniss
__________________
Klick hier
f@gju ist offline   Mit Zitat antworten
Alt 09-10-2003, 08:53   #5 (permalink)
Genius
 
Benutzerbild von f@gju
 
Registriert seit: Sep 2003
Ort: Banned into Jail
Beiträge: 650
oki haben gemacht
Angehängte Dateien
Dateityp: zip alpha.zip (2,4 KB, 7x aufgerufen)
__________________
Klick hier
f@gju ist offline   Mit Zitat antworten
Alt 09-10-2003, 14:34   #6 (permalink)
Neuer User
 
Registriert seit: Aug 2003
Ort: Bamberg
Beiträge: 876
supi dupi =) das is sehr nett von dir hehe =) ich zeig dir dann mal nachert was ich draus gemacht hab (soll nur ne spielerei sein...um ein bisschen am as rumzuwerkeln etc)
also vielen dank nomma
wangman ist offline   Mit Zitat antworten
Alt 09-10-2003, 15:57   #7 (permalink)
Neuer User
 
Registriert seit: Aug 2003
Ort: Bamberg
Beiträge: 876
also ich hab meine alte datei nich mehr gefunden da hab ich einfach schnell ne neue gemacht nach deinem beispiel jetzt hab ich ein problem du wirst es sicher sofort merken wenn ich jetzt über das alle kästchen roll egal welches von den sechs wird immer nur das letzte durchsichtig (mc6) was hab ich falsch gemacht??? hier die datei :
Angehängte Dateien
Dateityp: zip test2.zip (907 Bytes, 1x aufgerufen)
wangman ist offline   Mit Zitat antworten
Alt 09-10-2003, 16:00   #8 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
mit ner fla könnte man mehr anfangen!
__________________
Bitte keine Fragen, zu Flash per PM. Dazu ist das Forum da. Danke MFG_RustyCake!
"Wer tanzen will, muß erst gehen lernen"
RustyCake ist offline   Mit Zitat antworten
Alt 09-10-2003, 16:06   #9 (permalink)
Neuer User
 
Registriert seit: Aug 2003
Ort: Bamberg
Beiträge: 876
ach ne??! ja das einzige problem ist das die gezippt 1,5 mb groß ist ich hab mir gedacht wenn er ne idee hat dann lad ichs aufn extra server aber danke is ja nett gemeint ! =)
und der fehler könnte ja auch im as liegen daher
ActionScript:
  1. _root.mc.cmd.onRollOver = function(){
  2.     clearInterval(_root.intID);
  3.     _root.intID = setInterval(fadeIt, 50, false);
  4.     _root.endwert = 20 + Math.ceil((Math.random() * 50));   
  5. }
  6.  
  7. _root.mc.cmd.onRollOut = function(){
  8.     clearInterval(_root.intID);
  9.     _root.intID = setInterval(fadeIt, 50, true);
  10.     _root.endwert = 20 + Math.ceil((Math.random() * 50));
  11. }
  12. function fadeIt(hoch){
  13.     if(hoch){
  14.         if(_root.mc._alpha < 80){
  15.             _root.mc._alpha += 2;
  16.         }else{
  17.                 clearInterval(_root.intID);
  18.         }   
  19.     }else{
  20.         if(_root.mc._alpha > _root.endwert){
  21.             _root.mc._alpha -= 2;
  22.         }else{
  23.                 clearInterval(_root.intID);
  24.         }
  25.     }
  26. }
  27. _root.mc2.cmd2.onRollOver = function(){
  28.     clearInterval(_root.intID);
  29.     _root.intID = setInterval(fadeIt, 50, false);
  30.     _root.endwert = 20 + Math.ceil((Math.random() * 50));   
  31. }
  32.  
  33. _root.mc2.cmd2.onRollOut = function(){
  34.     clearInterval(_root.intID);
  35.     _root.intID = setInterval(fadeIt, 50, true);
  36.     _root.endwert = 20 + Math.ceil((Math.random() * 50));
  37. }
  38. function fadeIt(hoch){
  39.     if(hoch){
  40.         if(_root.mc2._alpha < 80){
  41.             _root.mc2._alpha += 2;
  42.         }else{
  43.                 clearInterval(_root.intID);
  44.         }   
  45.     }else{
  46.         if(_root.mc2._alpha > _root.endwert){
  47.             _root.mc2._alpha -= 2;
  48.         }else{
  49.                 clearInterval(_root.intID);
  50.         }
  51.     }
  52. }
  53. _root.mc3.cmd3.onRollOver = function(){
  54.     clearInterval(_root.intID);
  55.     _root.intID = setInterval(fadeIt, 50, false);
  56.     _root.endwert = 20 + Math.ceil((Math.random() * 50));   
  57. }
  58.  
  59. _root.mc3.cmd3.onRollOut = function(){
  60.     clearInterval(_root.intID);
  61.     _root.intID = setInterval(fadeIt, 50, true);
  62.     _root.endwert = 20 + Math.ceil((Math.random() * 50));
  63. }
  64. function fadeIt(hoch){
  65.     if(hoch){
  66.         if(_root.mc3._alpha < 80){
  67.             _root.mc3._alpha += 2;
  68.         }else{
  69.                 clearInterval(_root.intID);
  70.         }   
  71.     }else{
  72.         if(_root.mc3._alpha > _root.endwert){
  73.             _root.mc3._alpha -= 2;
  74.         }else{
  75.                 clearInterval(_root.intID);
  76.         }
  77.     }
  78. }
  79. _root.mc4.cmd4.onRollOver = function(){
  80.     clearInterval(_root.intID);
  81.     _root.intID = setInterval(fadeIt, 50, false);
  82.     _root.endwert = 20 + Math.ceil((Math.random() * 50));   
  83. }
  84.  
  85. _root.mc4.cmd4.onRollOut = function(){
  86.     clearInterval(_root.intID);
  87.     _root.intID = setInterval(fadeIt, 50, true);
  88.     _root.endwert = 20 + Math.ceil((Math.random() * 50));
  89. }
  90. function fadeIt(hoch){
  91.     if(hoch){
  92.         if(_root.mc4._alpha < 80){
  93.             _root.mc4._alpha += 2;
  94.         }else{
  95.                 clearInterval(_root.intID);
  96.         }   
  97.     }else{
  98.         if(_root.mc4._alpha > _root.endwert){
  99.             _root.mc4._alpha -= 2;
  100.         }else{
  101.                 clearInterval(_root.intID);
  102.         }
  103.     }
  104. }
  105. _root.mc5.cmd5.onRollOver = function(){
  106.     clearInterval(_root.intID);
  107.     _root.intID = setInterval(fadeIt, 50, false);
  108.     _root.endwert = 20 + Math.ceil((Math.random() * 50));   
  109. }
  110.  
  111. _root.mc5.cmd5.onRollOut = function(){
  112.     clearInterval(_root.intID);
  113.     _root.intID = setInterval(fadeIt, 50, true);
  114.     _root.endwert = 20 + Math.ceil((Math.random() * 50));
  115. }
  116. function fadeIt(hoch){
  117.     if(hoch){
  118.         if(_root.mc5._alpha < 80){
  119.             _root.mc5._alpha += 2;
  120.         }else{
  121.                 clearInterval(_root.intID);
  122.         }   
  123.     }else{
  124.         if(_root.mc5._alpha > _root.endwert){
  125.             _root.mc5._alpha -= 2;
  126.         }else{
  127.                 clearInterval(_root.intID);
  128.         }
  129.     }
  130. }
  131. _root.mc6.cmd6.onRollOver = function(){
  132.     clearInterval(_root.intID);
  133.     _root.intID = setInterval(fadeIt, 50, false);
  134.     _root.endwert = 20 + Math.ceil((Math.random() * 50));   
  135. }
  136.  
  137. _root.mc6.cmd6.onRollOut = function(){
  138.     clearInterval(_root.intID);
  139.     _root.intID = setInterval(fadeIt, 50, true);
  140.     _root.endwert = 20 + Math.ceil((Math.random() * 50));
  141. }
  142. function fadeIt(hoch){
  143.     if(hoch){
  144.         if(_root.mc6._alpha < 80){
  145.             _root.mc6._alpha += 2;
  146.         }else{
  147.                 clearInterval(_root.intID);
  148.         }   
  149.     }else{
  150.         if(_root.mc6._alpha > _root.endwert){
  151.             _root.mc6._alpha -= 2;
  152.         }else{
  153.                 clearInterval(_root.intID);
  154.         }
  155.     }
  156. }
wangman ist offline   Mit Zitat antworten
Alt 09-10-2003, 16:31   #10 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
ne function ist ja eigentlich dafür da von mehreren buttons (in diesem fall) verwendet zu werden
ActionScript:
  1. _root.mc1.onRollOver = function() {
  2.     clearInterval(_root.intID);
  3.     _root.intID = setInterval(fadeIt, 50, false, this);
  4.     _root.endwert = 20+Math.ceil((Math.random()*50));
  5. };
  6. _root.mc1.onRollOut = function() {
  7.     clearInterval(_root.intID);
  8.     _root.intID = setInterval(fadeIt, 50, true, this);
  9.     _root.endwert = 20+Math.ceil((Math.random()*50));
  10. };
  11. _root.mc2.onRollOver = function() {
  12.     clearInterval(_root.intID);
  13.     _root.intID = setInterval(fadeIt, 50, false, this);
  14.     _root.endwert = 20+Math.ceil((Math.random()*50));
  15. };
  16. _root.mc2.onRollOut = function() {
  17.     clearInterval(_root.intID);
  18.     _root.intID = setInterval(fadeIt, 50, true, this);
  19.     _root.endwert = 20+Math.ceil((Math.random()*50));
  20. };
  21. _root.mc3.onRollOver = function() {
  22.     clearInterval(_root.intID);
  23.     _root.intID = setInterval(fadeIt, 50, false, this);
  24.     _root.endwert = 20+Math.ceil((Math.random()*50));
  25. };
  26. _root.mc3.onRollOut = function() {
  27.     clearInterval(_root.intID);
  28.     _root.intID = setInterval(fadeIt, 50, true, this);
  29.     _root.endwert = 20+Math.ceil((Math.random()*50));
  30. };
  31. function fadeIt(hoch, mc) {
  32.     if (hoch) {
  33.         if (mc._alpha<80) {
  34.             mc._alpha += 2;
  35.         } else {
  36.             clearInterval(_root.intID);
  37.         }
  38.     } else {
  39.         if (mc._alpha>_root.endwert) {
  40.             mc._alpha -= 2;
  41.         } else {
  42.             clearInterval(_root.intID);
  43.         }
  44.     }
  45. }
mußt halt des script an Deines anpassen!
Angehängte Dateien
Dateityp: zip function_fade.zip (2,9 KB, 2x aufgerufen)
__________________
Bitte keine Fragen, zu Flash per PM. Dazu ist das Forum da. Danke MFG_RustyCake!
"Wer tanzen will, muß erst gehen lernen"
RustyCake ist offline   Mit Zitat antworten
Alt 09-10-2003, 16:48   #11 (permalink)
_//\\#//\\_
 
Benutzerbild von warrantmaster
 
Registriert seit: Jan 2003
Beiträge: 7.060
ActionScript:
  1. for (var i = 1; i<=3; i++) {
  2.     _root['mc'+i].onRollOver = function() {
  3.         clearInterval(_root.intID);
  4.         _root.intID = setInterval(fadeIt, 50, false, this);
  5.         _root.endwert = 20+Math.ceil((Math.random()*50));
  6.     };
  7.     _root['mc'+i].onRollOut = function() {
  8.         clearInterval(_root.intID);
  9.         _root.intID = setInterval(fadeIt, 50, true, this);
  10.         _root.endwert = 20+Math.ceil((Math.random()*50));
  11.     };
  12. }


hey meister rusty....schreibwütig heute...
warrantmaster ist offline   Mit Zitat antworten
Alt 09-10-2003, 16:50   #12 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
Hehe hast recht, bin a bisserl Banane!
bin verliebt
__________________
Bitte keine Fragen, zu Flash per PM. Dazu ist das Forum da. Danke MFG_RustyCake!
"Wer tanzen will, muß erst gehen lernen"
RustyCake ist offline   Mit Zitat antworten
Alt 09-10-2003, 16:55   #13 (permalink)
_//\\#//\\_
 
Benutzerbild von warrantmaster
 
Registriert seit: Jan 2003
Beiträge: 7.060
Zitat:
Geschrieben von RustyCake
Hehe hast recht, bin a bisserl Banane!
bin verliebt

sach ich doch...der kerl ist völlig durch den wind....


glückwunsch mein guter !
warrantmaster ist offline   Mit Zitat antworten
Alt 09-10-2003, 17:44   #14 (permalink)
Neuer User
 
Registriert seit: Aug 2003
Ort: Bamberg
Beiträge: 876
tsss irgendwie seid ihr ja schon an bissal krank ich mein ja nur ich bekomm html ja noch gebacken aber as nicht so wirklich ... und ihr kommt da her und sagt schub die wub und tralla la hier der as is da naja es gibt leute die gibts garnet meinen freund jonny z.b. aber auch egal ich bedanke mich recht herzlich bei euch für die antwort und hab eine letzte frage!
Wie verdammt habt ihr as gelernt????
wangman ist offline   Mit Zitat antworten
Alt 09-10-2003, 17:48   #15 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
gelernt hab ich's zum größten Teil hier im FF, und von the "Godfather of Actionscript" Mr. Moock
__________________
Bitte keine Fragen, zu Flash per PM. Dazu ist das Forum da. Danke MFG_RustyCake!
"Wer tanzen will, muß erst gehen lernen"
RustyCake 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 00:01 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele