Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 11-01-2005, 18:53   #1 (permalink)
Affine Abbildung
 
Benutzerbild von Samuel
 
Registriert seit: Feb 2002
Ort: Bremen
Beiträge: 15.089
Button 1 löst ani, button 2 auch, aber erst wenn ani1 fertig ist

Ich dachte, ich hätte doch noch genug behalten, um das problem lösen zu können.

Ich habe eine Reihe von Buttons und eine einzige Animation, diese soll von 1 zu 6 laufen, wenn einer der buttons n rollOver hat und von 6 zu 1, wenn ein rollOut statt findet.
Gut so dumm bin ich nicht

ActionScript:
  1. _global.info = function (chap){
  2.     if (chap=="aus"){
  3.         _root.info.onEnterFrame = bwd; 
  4.     } else {
  5. _root.info.onEnterFrame = fwd;
  6. }}
  7. fwd = function() {
  8.     if (this._currentframe!=this._totalframes){
  9.         this.nextFrame();
  10.     } else {
  11.        
  12.         delete this.onEnterFrame;
  13.     }
  14. }
  15.  
  16. bwd = function() {
  17.     if (this._currentframe>=1){
  18.         this.prevFrame();
  19.     } else {
  20.         delete this.onEnterFrame;
  21.     }
  22. }


die funktion info tut noch andere dinge, also die darf nicht weg, "aus" ist der param der funktion, wenn ani aussoll.
Dies hier funktioniert auch problemlos.
Aber der haken an der sache ist, dass ich ja mehrere buttons habe, und rollOut von button 1 und das rollOver von button2 sich überschneide, so wird rollOver von button 2 ausgeführt.
Der gewünschte Effekt ist aber, dass ich auch bei diesem zügigen wechsel zuerst ein kompletter rücklauf, also rollOut ausgeführt werden soll und dann rollOver.
Quasi memory effekt, jedoch sollte der memory effekt nicht so ablaufen, dass wenn ich mit eimal über 10 buttons rutsche, alles der reihe nach abgefeuert wird
__________________
Solange sich auch nur einer an ihn erinnert, solange auch nur ein Herz mit Leidenschaft schlägt - wie kann ein Traum da sterben?

If you use the wrong line ending characters when writing your files, you might find that other applications that open those files will "look funny". - PHP.net

Hier ruhn meine Gebeine - ich wollt, es wären Deine.

Try to look unimportant, they may be low on ammo!

Was ist euer Lieblings-Datentyp? Schreibt mir!
Samuel ist offline   Mit Zitat antworten
Alt 11-01-2005, 19:09   #2 (permalink)
:-(
*unknown user*
 
Benutzerbild von :-(
 
Registriert seit: Jan 2005
Beiträge: 137
versuch das mal:

ActionScript:
  1. _global.info = function (chap){
  2.     if (_global.isActive) {
  3.         if (chap=="aus"){
  4.             _root.info.onEnterFrame = bwd;   
  5.         } else {
  6.            _root.info.onEnterFrame = fwd;
  7.         }
  8.     }
  9. }
  10. fwd = function() {
  11.     if (this._currentframe!=this._totalframes){
  12.         _global.isActive = false;
  13.         this.nextFrame();
  14.     } else {
  15.        
  16.         delete this.onEnterFrame;
  17.     }
  18. }
  19.  
  20. bwd = function() {
  21.     if (this._currentframe>=1){
  22.         this.prevFrame();
  23.     } else {
  24.         _global.isActive = true;
  25.         delete this.onEnterFrame;
  26.     }
  27. }

Sobald einer der buttons gedrückt wird ist _global.isActive = true; und die info-funktion is für andere buttons gespeert und wird erst wieder freigegeben wenn die ani wieder auf frame 1 ist.

Geändert von :-( (11-01-2005 um 19:11 Uhr)
:-( ist offline   Mit Zitat antworten
Alt 12-01-2005, 09:37   #3 (permalink)
Affine Abbildung
 
Benutzerbild von Samuel
 
Registriert seit: Feb 2002
Ort: Bremen
Beiträge: 15.089
Teste ich, wenn ich zu hause bin, aber ich glaub dass ist nicht das, was ich wollte.

Nach längerem draufgucken ist es vielleicht doch, dass was ich will.
Meine versuchsversion fragte immer die currentframes ab, aber ich glaub ich hab mich da auch nur verhedert.
Besten dank, ich gebe bescheid, wenn ich das resultat kenne
__________________
Solange sich auch nur einer an ihn erinnert, solange auch nur ein Herz mit Leidenschaft schlägt - wie kann ein Traum da sterben?

If you use the wrong line ending characters when writing your files, you might find that other applications that open those files will "look funny". - PHP.net

Hier ruhn meine Gebeine - ich wollt, es wären Deine.

Try to look unimportant, they may be low on ammo!

Was ist euer Lieblings-Datentyp? Schreibt mir!
Samuel ist offline   Mit Zitat antworten
Alt 12-01-2005, 12:23   #4 (permalink)
Affine Abbildung
 
Benutzerbild von Samuel
 
Registriert seit: Feb 2002
Ort: Bremen
Beiträge: 15.089
ne funzt rein garnichts mehr,denn du hast weder vorher die isactive auf true gesetzt, damit wenigstens zu begin was gemacht wird

Noch hast du beachtet, das isActive n reserviertes wort ist, aber nach der änderung in ein nicht reserviertes wort ging das ding auf, aber nie wieder zu
__________________
Solange sich auch nur einer an ihn erinnert, solange auch nur ein Herz mit Leidenschaft schlägt - wie kann ein Traum da sterben?

If you use the wrong line ending characters when writing your files, you might find that other applications that open those files will "look funny". - PHP.net

Hier ruhn meine Gebeine - ich wollt, es wären Deine.

Try to look unimportant, they may be low on ammo!

Was ist euer Lieblings-Datentyp? Schreibt mir!
Samuel ist offline   Mit Zitat antworten
Alt 12-01-2005, 16:15   #5 (permalink)
mentally ill
 
Registriert seit: Aug 2004
Beiträge: 172
probier das mal...

PHP-Code:
  _global.info = function (chap) { 
    if (
chap=="aus") { 
        
_root.info.onEnterFrame bwd(); 
    } else { 
         
_root.info.onEnterFrame fwd (); 
     } 


 function 
fwd () { 
    if (
this._currentframe != this._totalframes){ 
        
this.nextFrame(); 
    } else { 
        
delete this.onEnterFrame
    } 
 } 

 function 
bwd () { 
    if (
this._currentframe>=1){ 
        
this.prevFrame(); 
    } else { 
        
delete this.onEnterFrame
     } 
 } 
wenns nicht klappt evt. mal
PHP-Code:
_root.info.onEnterFrame _root.fwd (); 
und

PHP-Code:
 _root.info.onEnterFrame _root.fwd (); 
versuchen

grüße
markus
__________________
there is no place like 127.0.0.1
--------------------------------------------------
[STUFF] E-Mail Liste für Newsletter o.ä.
[STUFF] MySQLConnector Klasse

Geändert von menty (12-01-2005 um 16:17 Uhr)
menty ist offline   Mit Zitat antworten
Alt 12-01-2005, 16:59   #6 (permalink)
querdenker
 
Benutzerbild von kelor
 
Registriert seit: Jun 2001
Ort: formel1-stadt hockenheim
Beiträge: 4.731
ActionScript:
  1. _global._isActive = true;
  2. _global.infoFunc = function (chap){
  3.     this = arguments.callee;
  4.     if (_isActive) {
  5.         if (chap=="ein"){
  6.             trace('hello');
  7.             _global._isActive = false;
  8.             _root.info.onEnterFrame = fwd;   
  9.         } else {
  10.             _global._isActive = false;
  11.            _root.info.onEnterFrame = bwd;
  12.         }
  13.     }else{
  14.         this.commandArr.push(chap);
  15.     }
  16. }
  17. _global.infoFunc.commandArr=[];
  18.  
  19.  
  20. fwd = function() {
  21.     if (this._currentframe!=this._totalframes){
  22.         this.nextFrame();
  23.     } else {
  24.         _global._isActive = true;
  25.         delete this.onEnterFrame;
  26.         if(infoFunc.commandArr.length > 0) {var tmp = infoFunc.commandArr[0]; infoFunc(tmp); return infoFunc.commandArr.shift();}
  27.     }
  28. }
  29.  
  30. bwd = function() {
  31.     if (this._currentframe>1){
  32.         this.prevFrame();
  33.     } else {
  34.         _global._isActive = true;
  35.         delete this.onEnterFrame;
  36.         if(infoFunc.commandArr.length > 0) {var tmp = infoFunc.commandArr[0]; infoFunc(tmp); return infoFunc.commandArr.shift();}
  37.     }
  38. }
  39.  
  40.  
  41. btn.onPress = function(){
  42.     infoFunc('ein');
  43. }
  44. btn.onRelease = function(){
  45.     infoFunc('aus');
  46. }




greetz

kelor
kelor ist offline   Mit Zitat antworten
Alt 12-01-2005, 17:12   #7 (permalink)
:-(
*unknown user*
 
Benutzerbild von :-(
 
Registriert seit: Jan 2005
Beiträge: 137
Zitat:
Zitat von menty
probier das mal...

PHP-Code:
  _global.info = function (chap) { 
    if (
chap=="aus") { 
        
_root.info.onEnterFrame bwd(); 
    } else { 
         
_root.info.onEnterFrame fwd (); 
     } 


 function 
fwd () { 
    if (
this._currentframe != this._totalframes){ 
        
this.nextFrame(); 
    } else { 
        
delete this.onEnterFrame
    } 
 } 

 function 
bwd () { 
    if (
this._currentframe>=1){ 
        
this.prevFrame(); 
    } else { 
        
delete this.onEnterFrame
     } 
 } 
wenns nicht klappt evt. mal
PHP-Code:
_root.info.onEnterFrame _root.fwd (); 
und

PHP-Code:
 _root.info.onEnterFrame _root.fwd (); 
versuchen

grüße
markus
? Wo is da der unterschied zu samuel's script? Oder bin ich zu blöd oO
:-( ist offline   Mit Zitat antworten
Alt 12-01-2005, 17:22   #8 (permalink)
querdenker
 
Benutzerbild von kelor
 
Registriert seit: Jun 2001
Ort: formel1-stadt hockenheim
Beiträge: 4.731
da war kein unterschied bei dessen script..*zustimm*

aber samuel...guggst du eins drüber meinen kot..

merkt sich sogar die buttonaktion in einem eigenen array..

greetz

kelor
kelor ist offline   Mit Zitat antworten
Alt 12-01-2005, 17:34   #9 (permalink)
Affine Abbildung
 
Benutzerbild von Samuel
 
Registriert seit: Feb 2002
Ort: Bremen
Beiträge: 15.089
jep, kelor, sieht sehr gut aus, vielen dank
__________________
Solange sich auch nur einer an ihn erinnert, solange auch nur ein Herz mit Leidenschaft schlägt - wie kann ein Traum da sterben?

If you use the wrong line ending characters when writing your files, you might find that other applications that open those files will "look funny". - PHP.net

Hier ruhn meine Gebeine - ich wollt, es wären Deine.

Try to look unimportant, they may be low on ammo!

Was ist euer Lieblings-Datentyp? Schreibt mir!
Samuel ist offline   Mit Zitat antworten
Alt 12-01-2005, 17:47   #10 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
Yupp! Suppi kelor, gefällt mir
Darf ich noch einen kleinen proto beisteuern der des vor und rückspulen in einem vereint
ActionScript:
  1. var anzahl_buttons = 4;
  2. _global._isActive = true;
  3. _global.infoFunc = function(chap) {
  4.     this = arguments.callee;
  5.     if (_isActive) {
  6.         if (chap == "ein") {
  7.             trace("hello");
  8.             _global._isActive = false;
  9.             _root.info.fade("NextFrame");
  10.         } else {
  11.             _global._isActive = false;
  12.             _root.info.fade("PrevFrame");
  13.         }
  14.     } else {
  15.         this.commandArr.push(chap);
  16.     }
  17. };
  18. _global.infoFunc.commandArr = [];
  19. MovieClip.prototype.fade = function(sl) {
  20.     this.onEnterFrame = function() {
  21.         this[sl]();
  22.         if ((this._currentframe == 1) || (this._currentframe == this._totalframes)) {
  23.             delete this.onEnterFrame;
  24.             _global._isActive = true;
  25.             if (infoFunc.commandArr.length>0) {
  26.                 var tmp = infoFunc.commandArr[0];
  27.                 infoFunc(tmp);
  28.                 return infoFunc.commandArr.shift();
  29.             }
  30.         }
  31.     };
  32. };
  33. for (var i = 1; i<=anzahl_buttons; i++) {
  34.     _root["mc"+i].onRollOver = function() {
  35.         infoFunc('ein');
  36.     };
  37.     _root["mc"+i].onRollOut = function() {
  38.         infoFunc('aus');
  39.     };
  40. }
__________________
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 23:58 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele