Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 31-07-2003, 13:52   #1 (permalink)
backToThe._roots
 
Benutzerbild von Blax_ed
 
Registriert seit: Feb 2003
Ort: Ebnat-Kappel [CH]
Beiträge: 1.571
fade function

in die mainframe wird eine sound und eine sound2 hineingeladen (externes swf) die sounds sind in diesesn externen dateien über :

ActionScript:
  1. meinSound2 = new Sound(this);
  2. meinSound2.attachSound("snd1");

attached..
der erste wird gestartet... der sound2 wird nur geladen und noch nicht gestartet...
in den mainframe wird jetz ein drittes swf mit einem knop hineingeladen...
aufm frame liegt:
ActionScript:
  1. knopf1.onRelease = function() {
  2.         i = _root.meinSound.getVolume();
  3.         this.onEnterFrame = function() {
  4.                 i -= 15;//je kleiner umso langsamer
  5.                 _root.meinSound.getVolume()>0 ? _root.meinSound.setVolume(i) : delete this.onEnterFrame;
  6.                 trace(_root.meinSound.getVolume());
  7.                 //gotoAndStop(3);
  8.                
  9.         };
  10.         _root.drop2._visible=true;
  11.         _root.count2="aktuell";
  12.         //_root.meinSound2.start(0,99999);
  13.         _root.soundconti2.gotoAndPlay(2);
  14.  
  15.    if (_root.hm=="not") {
  16.   _root.drop2.loadMovie ("aktuell.swf");
  17. }
  18.  
  19.    if (_root.hm == "aktuell") {
  20.         _root.drop2.gotoAndStop(15);
  21.   }else{
  22.    _root.drop2.gotoAndPlay (16);
  23. }
  24. };
das mit den unteren variablen funktioniert nur die fadeout funktion, bis zu dem //gotoAndStop(3) funzt net...
hat jemand ne ahnung warum??
__________________
Cheers,
Flow!

Geändert von Blax_ed (31-07-2003 um 14:22 Uhr)
Blax_ed ist offline   Mit Zitat antworten
Alt 31-07-2003, 15:14   #2 (permalink)
Hirnverbrannt
 
Benutzerbild von NastyFrog
 
Registriert seit: Aug 2001
Ort: AUSTRIA
Beiträge: 2.020
Is der knopf1 ein Button, oder ein MC? Bei Buttons gibts nämlich kein onEnterFrame.
__________________
50 Seiten hardcore ActionScript von den Grundlagen bis zu 3D Darstellungen.... eben eine Abendlektüre.

Dogs fucked the Pope, no fault of mine. Watch out! ... Why money? My name is Brinks; I was born ... born? Get sheep over side ... women and children to armored car ... orders from Captain Zeep.(Hunter S. Thompson)
NastyFrog ist offline   Mit Zitat antworten
Alt 31-07-2003, 15:29   #3 (permalink)
backToThe._roots
 
Benutzerbild von Blax_ed
 
Registriert seit: Feb 2003
Ort: Ebnat-Kappel [CH]
Beiträge: 1.571
hast recht ... bin soo doof... das ist ein button...

wie kann ich das script den passend für einen button schreiben..
will den button nicht einfach zu einem mc machen...weil roll over etc..
__________________
Cheers,
Flow!
Blax_ed ist offline   Mit Zitat antworten
Alt 31-07-2003, 15:33   #4 (permalink)
Steffen G.
 
Benutzerbild von Tschdaeff
 
Registriert seit: Aug 2001
Ort: Ba-Wü
Beiträge: 4.123
ActionScript:
  1. knopf1.onRelease = function() {
  2. if (!this.done) {
  3.         _root.createEmptyMovieClip ("mc",1000)
  4.         this.done = 1
  5. }
  6.         i = _root.meinSound.getVolume();
  7.        _root.mc.onEnterFrame = function() {
  8.                 i -= 15;//je kleiner umso langsamer
  9.                 _root.meinSound.getVolume()>0 ? _root.meinSound.setVolume(i) : delete _root.mc.onEnterFrame;
  10.                 trace(_root.meinSound.getVolume());
  11.                 //gotoAndStop(3);
  12.                
  13.         };
  14.         _root.drop2._visible=true;
  15.         _root.count2="aktuell";
  16.         //_root.meinSound2.start(0,99999);
  17.         _root.soundconti2.gotoAndPlay(2);
  18.        
  19.         if (_root.hm=="not") {
  20.                 _root.drop2.loadMovie ("aktuell.swf");
  21.         }
  22.        
  23.         if (_root.hm == "aktuell") {
  24.                 _root.drop2.gotoAndStop(15);
  25.         }else{
  26.                 _root.drop2.gotoAndPlay (16);
  27.         }
  28. };


kannst das mal versuchen

cu mfg
Tschdaeff
__________________
mod@
www.flashbattle.de
www.steffen-guse.de
------------------------------------

Tschdaeff ist offline   Mit Zitat antworten
Alt 31-07-2003, 15:33   #5 (permalink)
Hirnverbrannt
 
Benutzerbild von NastyFrog
 
Registriert seit: Aug 2001
Ort: AUSTRIA
Beiträge: 2.020
Is seit MX egal. Da kann man Button Events einfach auf MCs geben. Deshalb werden Buttons nur noch selten verwendet.
__________________
50 Seiten hardcore ActionScript von den Grundlagen bis zu 3D Darstellungen.... eben eine Abendlektüre.

Dogs fucked the Pope, no fault of mine. Watch out! ... Why money? My name is Brinks; I was born ... born? Get sheep over side ... women and children to armored car ... orders from Captain Zeep.(Hunter S. Thompson)
NastyFrog ist offline   Mit Zitat antworten
Alt 31-07-2003, 15:47   #6 (permalink)
backToThe._roots
 
Benutzerbild von Blax_ed
 
Registriert seit: Feb 2003
Ort: Ebnat-Kappel [CH]
Beiträge: 1.571
@frog ja weiss ich... ich hab aber erst buttons gemacht wegen dem onmouse over und so (war halt zufaul alles zu programmieren... mit buttons gehts halt schneller...

@tschaedeff

ne funkt leider auch net...
__________________
Cheers,
Flow!
Blax_ed ist offline   Mit Zitat antworten
Alt 31-07-2003, 16:02   #7 (permalink)
Hirnverbrannt
 
Benutzerbild von NastyFrog
 
Registriert seit: Aug 2001
Ort: AUSTRIA
Beiträge: 2.020
Bei Tschdaeff's Version musst du einmal das done auf dem Button auf false setzen, damit das erste if funkt.
__________________
50 Seiten hardcore ActionScript von den Grundlagen bis zu 3D Darstellungen.... eben eine Abendlektüre.

Dogs fucked the Pope, no fault of mine. Watch out! ... Why money? My name is Brinks; I was born ... born? Get sheep over side ... women and children to armored car ... orders from Captain Zeep.(Hunter S. Thompson)
NastyFrog ist offline   Mit Zitat antworten
Alt 01-08-2003, 08:12   #8 (permalink)
backToThe._roots
 
Benutzerbild von Blax_ed
 
Registriert seit: Feb 2003
Ort: Ebnat-Kappel [CH]
Beiträge: 1.571
hä?? wie meinst du das...?? (steh grad auf dem schlauch..)
__________________
Cheers,
Flow!
Blax_ed ist offline   Mit Zitat antworten
Alt 01-08-2003, 10:44   #9 (permalink)
Hirnverbrannt
 
Benutzerbild von NastyFrog
 
Registriert seit: Aug 2001
Ort: AUSTRIA
Beiträge: 2.020
Naja, du hast gesagt seine Version funkt nicht und das liegt daran, dass this.done beim ersten mal nicht gesetzt ist.
Hier:
if (!this.done) {....

Du musst das done einmal auf false setzten, damit das erste if ausgeführt wird und der mc erstellt wird.
__________________
50 Seiten hardcore ActionScript von den Grundlagen bis zu 3D Darstellungen.... eben eine Abendlektüre.

Dogs fucked the Pope, no fault of mine. Watch out! ... Why money? My name is Brinks; I was born ... born? Get sheep over side ... women and children to armored car ... orders from Captain Zeep.(Hunter S. Thompson)
NastyFrog ist offline   Mit Zitat antworten
Alt 01-08-2003, 13:00   #10 (permalink)
backToThe._roots
 
Benutzerbild von Blax_ed
 
Registriert seit: Feb 2003
Ort: Ebnat-Kappel [CH]
Beiträge: 1.571
jo hatte ich schon verstanden nur wo soll ich das setzen??? so:?
ActionScript:
  1. done=false; ///??????
  2. knopf1.onRelease = function() {
  3.         if (!this.done) {
  4.                 _root.createEmptyMovieClip ("mc",1000)
  5.                 this.done = 1
  6.         }
  7.         i = _root.meinSound.getVolume();
  8.         _root.mc.onEnterFrame = function() {
  9.                 i -= 15;//je kleiner umso langsamer
  10.                 _root.meinSound.getVolume()>0 ? _root.meinSound.setVolume(i) : delete _root.mc.onEnterFrame;
  11.                 trace(_root.meinSound.getVolume());
  12.                 //gotoAndStop(3);
  13.                
  14.         };
  15.         _root.drop2._visible=true;
  16.         _root.count2="aktuell";
  17.         //_root.meinSound2.start(0,99999);
  18.         _root.soundconti2.gotoAndPlay(2);
  19.        
  20.         if (_root.hm=="not") {
  21.                 _root.drop2.loadMovie ("aktuell.swf");
  22.         }
  23.        
  24.         if (_root.hm == "aktuell") {
  25.                 _root.drop2.gotoAndStop(15);
  26.         }else{
  27.                 _root.drop2.gotoAndPlay (16);
  28.         }
  29. };

oder wie meinst du das??
__________________
Cheers,
Flow!
Blax_ed ist offline   Mit Zitat antworten
Alt 01-08-2003, 13:13   #11 (permalink)
Hirnverbrannt
 
Benutzerbild von NastyFrog
 
Registriert seit: Aug 2001
Ort: AUSTRIA
Beiträge: 2.020
knopf1.done = false;

Dann sollts funken.
__________________
50 Seiten hardcore ActionScript von den Grundlagen bis zu 3D Darstellungen.... eben eine Abendlektüre.

Dogs fucked the Pope, no fault of mine. Watch out! ... Why money? My name is Brinks; I was born ... born? Get sheep over side ... women and children to armored car ... orders from Captain Zeep.(Hunter S. Thompson)
NastyFrog 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 09:25 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele