Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 15-01-2006, 11:57   #1 (permalink)
Neuer User
 
Registriert seit: Oct 2005
Beiträge: 61
"ID" Frage

Hallo

Hab ein wahrscheinlich total simples problem, doch ich hab alles probiert was ich bis jetzt weiß und es geht nicht. Ich möchte, dass die if anweisung nicht nur für 2, sondern auch für 3 gilt?
PHP-Code:
if (_root.bar.lastMC.ID == 2
mouzZ ist offline   Mit Zitat antworten
Alt 15-01-2006, 11:59   #2 (permalink)
mod_rewrite
 
Benutzerbild von sonar
 
Registriert seit: Feb 2003
Ort: München
Beiträge: 15.621
2 oder 3:
ActionScript:
  1. if (_root.bar.lastMC.ID == 2 || _root.bar.lastMC.ID == 3)
__________________
RTFM
Wie man Fragen richtig stellt.

Achim Bindannmalweg

Money makes the world go round, fear makes it turn much faster.
(New Model Army)
sonar ist offline   Mit Zitat antworten
Alt 15-01-2006, 12:19   #3 (permalink)
Neuer User
 
Registriert seit: Oct 2005
Beiträge: 61
gut danke

war aber schon knapp dran^^
mouzZ ist offline   Mit Zitat antworten
Alt 15-01-2006, 12:23   #4 (permalink)
Neuer User
 
Registriert seit: Oct 2005
Beiträge: 61
hmm merk grad es geht doch nicht??
mouzZ ist offline   Mit Zitat antworten
Alt 15-01-2006, 12:24   #5 (permalink)
mod_rewrite
 
Benutzerbild von sonar
 
Registriert seit: Feb 2003
Ort: München
Beiträge: 15.621
Was geht nicht?
__________________
RTFM
Wie man Fragen richtig stellt.

Achim Bindannmalweg

Money makes the world go round, fear makes it turn much faster.
(New Model Army)
sonar ist offline   Mit Zitat antworten
Alt 15-01-2006, 12:26   #6 (permalink)
Neuer User
 
Registriert seit: Oct 2005
Beiträge: 61
es funktioniert immer noch nur 2
mouzZ ist offline   Mit Zitat antworten
Alt 15-01-2006, 12:41   #7 (permalink)
mod_rewrite
 
Benutzerbild von sonar
 
Registriert seit: Feb 2003
Ort: München
Beiträge: 15.621
Ja und... soll ich jetzt raten oder in die Kristallkugel schauen, warum's bei dir nicht geht..?
Die if-Bedingung ist jedenfalls von der Syntax her richtig...
__________________
RTFM
Wie man Fragen richtig stellt.

Achim Bindannmalweg

Money makes the world go round, fear makes it turn much faster.
(New Model Army)
sonar ist offline   Mit Zitat antworten
Alt 15-01-2006, 19:48   #8 (permalink)
Neuer User
 
Registriert seit: Oct 2005
Beiträge: 61
Ne inne kugel musste nich schauen^^
Hier ist mal das script. Aber wieso kalppt das nicht, dass bei 2 und 3 die function
ausgeführt wird?
PHP-Code:
if (_root.bar.lastMC.ID == || _root.bar.lastMC.ID == 3) {
                
_root.freunde.onEnterFrame = function() {
                    
_root.freunde._x += (250-_root.freunde._x)/5;
                    if (
_root.bar._x<=-44) {
                        
_root.freunde._x += (-800-_root.freunde._x)/35;
                    }
                    if (
_root.freunde._x<=260) {
                        
_root.freunde._yscale += (120-_root.freunde._yscale)/5;
                        
_root.freunde._y += (65-_root.freunde._y)/5;
                    }
                    if (
_root.bar.lastMC.ID != || _root.bar.lastMC.ID != 3) {
                        
_root.freunde._yscale += (10-_root.freunde._yscale)/5;
                        
_root.freunde._y += (217-_root.freunde._y)/5;
                        if (
_root.freunde._yscale<=60) {
                            
_root.freunde._x += (1900-_root.freunde._x)/10;
                        }
                    }
                };
            }
        } 
mouzZ ist offline   Mit Zitat antworten
Alt 15-01-2006, 20:01   #9 (permalink)
Pending…
 
Benutzerbild von psyk
 
Registriert seit: Jul 2002
Ort: Hamburg
Beiträge: 3.866
Die Bedingung ansich ist uns schon klar.
Wir bräuchten noch ein Stückel mehr Skript, z.B. wie bzw. wo wird denn die ID
vergeben?
__________________
:: Warum einfach, wenn's auch kompliziert geht! ::
psyk ist offline   Mit Zitat antworten
Alt 15-01-2006, 20:11   #10 (permalink)
Neuer User
 
Registriert seit: Oct 2005
Beiträge: 61
aso sorry

PHP-Code:
for (var 0i<=10i++) {
    
_root.bar['button'+i].ID i;
    
_root.bar['button'+i].onRelease = function() {
        if (
_root.bar.lastMC != this) {
            
_root.bar.lastMC.foo(_root.bar.lastMC.x0100100_root.bar.lastMC.y);
            
_root.bar.lastMC this;
            
_root.bar.lastMC.this._x;
            
_root.bar.lastMC.this._y;
            
this.foo(1959029020010);
            if (
_root.bar.lastMC.ID == || _root.bar.lastMC.ID == 3) {
                
_root.freunde.onEnterFrame = function() {
                    
_root.freunde._x += (250-_root.freunde._x)/5;
                    if (
_root.bar._x<=-44) {
                        
_root.freunde._x += (-800-_root.freunde._x)/35;
                    }
                    if (
_root.freunde._x<=260) {
                        
_root.freunde._yscale += (120-_root.freunde._yscale)/5;
                        
_root.freunde._y += (65-_root.freunde._y)/5;
                    }
                    if (
_root.bar.lastMC.ID != || _root.bar.lastMC.ID != 3) {
                        
_root.freunde._yscale += (10-_root.freunde._yscale)/5;
                        
_root.freunde._y += (217-_root.freunde._y)/5;
                        if (
_root.freunde._yscale<=60) {
                            
_root.freunde._x += (1900-_root.freunde._x)/10;
                        }
                    }
                };
            }
        } 
mouzZ ist offline   Mit Zitat antworten
Alt 15-01-2006, 21:12   #11 (permalink)
Pending…
 
Benutzerbild von psyk
 
Registriert seit: Jul 2002
Ort: Hamburg
Beiträge: 3.866
Dein Fehler ist, lastMC hat keine ID nur button+#.
Also wenn überhaupt dann so.
PHP-Code:
for (var 0i<=10i++) {
    
_root.bar['button'+i].ID i;
    
_root.bar['button'+i].onRelease = function() {
        if (
_root.bar.lastMC != this) {
            
_root.bar.lastMC.foo(_root.bar.lastMC.x0100100_root.bar.lastMC.y);
            
_root.bar.lastMC this;
            
_root.bar.lastMC.this._x;
            
_root.bar.lastMC.this._y;
            
this.foo(1959029020010);
            if (
this.ID == || this.ID == 3) {
... 
__________________
:: Warum einfach, wenn's auch kompliziert geht! ::
psyk ist offline   Mit Zitat antworten
Alt 15-01-2006, 21:48   #12 (permalink)
Neuer User
 
Registriert seit: Oct 2005
Beiträge: 61
ich habs probiert aber es geht nicht
this ist doch lastMC.. oder seh ich das falsch?
mouzZ ist offline   Mit Zitat antworten
Alt 15-01-2006, 21:53   #13 (permalink)
Pending…
 
Benutzerbild von psyk
 
Registriert seit: Jul 2002
Ort: Hamburg
Beiträge: 3.866
Trace doch mal this, dann wirst du sehen das es die Referenz
des zuletzt gedrückten Button is, also _level0.bar.button# o.ä.


Edit: Endwerde das oder poste mal die fla.
__________________
:: Warum einfach, wenn's auch kompliziert geht! ::

Geändert von psyk (15-01-2006 um 21:55 Uhr)
psyk ist offline   Mit Zitat antworten
Alt 16-01-2006, 19:26   #14 (permalink)
Neuer User
 
Registriert seit: Oct 2005
Beiträge: 61
So ich hab mal die fla drangehängt!

Im prinzip möchte ich noch: - dass zum beispiel button 2 und 3 wie oben schon gesagt funktionieren

-dass, wenn man auf Bilder klickt die "hallo" buttons funktionieren(onRelease)

das wär erstmal alles denk ich
wenn ihr noch lust habt könnt ihr das script, wenns noch geht, einfacher schreiben. Bin ja noch Anfänger, und will ja wissen wie mans besser machen kann

Danke schon mal

mouzZ
Angehängte Dateien
Dateityp: rar hp.rar (11,4 KB, 4x aufgerufen)
mouzZ ist offline   Mit Zitat antworten
Alt 16-01-2006, 19:43   #15 (permalink)
Pending…
 
Benutzerbild von psyk
 
Registriert seit: Jul 2002
Ort: Hamburg
Beiträge: 3.866
Ich weiß ganrnich wasse willst funkt doch.
PHP-Code:
...
this.foo(1959029020010);
if (
_root.bar.lastMC.ID == || _root.bar.lastMC.ID == 3)
    {
        
trace('MC= '+_root.bar.lastMC._name+' mit ID= '+_root.bar.lastMC.ID+' gewählt');
... 
__________________
:: Warum einfach, wenn's auch kompliziert geht! ::
psyk 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 15:28 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele