Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 10-11-2005, 11:30   #1 (permalink)
LDA $#03 STA$4FD0
 
Benutzerbild von Analogic
 
Registriert seit: Sep 2002
Ort: Stuttgart
Beiträge: 213
Suche Ansatz für ein Problem

Hallo liebes Forum,

ich habe ein MC in der Bibliothek, Bezeichnet als doty. Dieses attache ich auf die Bühne und weise den instanznamen von 'doty1' bis 'doty400' zu.
PHP-Code:
makedotys=function(){
    
i=0;
    for (
yy=0;yy<20;yy++) {
        for (
xx=0;xx<20;xx++) {
            
i++;
            
wert0 'doty'//bezeichner in der Bibliothek
            
wert1 'doty'+i//instanzname
            
wert2 100+i//ebene
            
wert3 200+(xx*5);
            
wert4 200+(yy*5);
            
_root.attachMovie(wert0,wert1,wert2);
            
_root[wert1]._x wert3;
            
_root[wert1]._y wert4;
            
_root[wert1]._alpha 11;
            
trace(wert1);
        }
    }

funktioniert soweit tadellos. Es wird ein 20x20 großes Feld mit 4x4 Pixel großen 'doty' erstellt.

Mein Problem ist nun; wie kann ich all diese 'attachten' mcs mit 'onRollOver' ansprechen?

Gibt es eine bessere Methode als 400 Abfragen per
PHP-Code:
doty1.onRollOver()=function{
   
//inhalt
}
doty2.onRollOver()=function{
   
//inhalt
}
.
.

zu tätigen?

In einer Schleife (for/next oder do/while) mit
PHP-Code:
//Schleifen Anfang
i++;
_root['doty'+i].onRollOver()=function{
  
//inhalt
}
//Schleifen ENDE 
hat nichts gebracht.

Bin für jede HIlfe dankbar.

Greets
__________________
MfG Analogic - Leben ist Kunst

... Flash ist genial .. Flash macht spass .. Flashen will ich immermehr ;-)
Analogic ist offline   Mit Zitat antworten
Alt 10-11-2005, 11:33   #2 (permalink)
Pending…
 
Benutzerbild von psyk
 
Registriert seit: Jul 2002
Ort: Hamburg
Beiträge: 3.866
PHP-Code:
...
var 
_mc_root.attachMovie(wert0,wert1,wert2); 
_mc.onRollOver=function(){
trace('Anweisung')
}
... 
__________________
:: Warum einfach, wenn's auch kompliziert geht! ::
psyk ist offline   Mit Zitat antworten
Alt 10-11-2005, 11:33   #3 (permalink)
Der Wunderhund
 
Benutzerbild von gaspode
 
Registriert seit: Jun 2002
Ort: Hattingen
Beiträge: 10.515
was willst du denn machen?
das alle dotys als ein button reagieren?
dann attache sie doch alle in einen
movieclip und benutze den als button.

gruß, gaspode
gaspode ist offline   Mit Zitat antworten
Alt 10-11-2005, 11:41   #4 (permalink)
LDA $#03 STA$4FD0
 
Benutzerbild von Analogic
 
Registriert seit: Sep 2002
Ort: Stuttgart
Beiträge: 213
@gaspode

es ist ne MAtrix von 20x20 doty. Wenn der User mit der Maus drüber fliegt sollen sich die 'property' des MC wie z.B. der Alpha-Wert ändern.

@psyk

bei Deiner function ist es dasselbe.. das letzt 'doty400' wird angesprochen, die restlichen nicht.
__________________
MfG Analogic - Leben ist Kunst

... Flash ist genial .. Flash macht spass .. Flashen will ich immermehr ;-)
Analogic ist offline   Mit Zitat antworten
Alt 10-11-2005, 11:47   #5 (permalink)
no guts no glory
 
Benutzerbild von readme.txt
 
Registriert seit: May 2004
Ort: Nordhorn
Beiträge: 7.998
PHP-Code:
makedotys=function(){
    
i=0;
    for (
yy=0;yy<20;yy++) {
        for (
xx=0;xx<20;xx++) {
            
i++;
            
wert0 'doty'//bezeichner in der Bibliothek
            
wert1 'doty'+i//instanzname
            
wert2 100+i//ebene
            
wert3 200+(xx*5);
            
wert4 200+(yy*5);
            
punkt _root.attachMovie(wert0,wert1,wert2);
            
_root[wert1]._x wert3;
            
_root[wert1]._y wert4;
            
_root[wert1]._alpha 11;
            
            
_root[wert1].id i;
            
            
punkt.onRollOver = function() {
              
trace(this._name+": "+this.id);
            }
        }
    }

__________________
Bitte keine Privaten Nachrichten mit Fragen, dazu ist das Forum selbst da. Danke.

'We live in an amazing, amazing world, and it's wasted on the crappiest generation of spoiled idiots.'
readme.txt ist offline   Mit Zitat antworten
Alt 10-11-2005, 12:53   #6 (permalink)
Der Wunderhund
 
Benutzerbild von gaspode
 
Registriert seit: Jun 2002
Ort: Hattingen
Beiträge: 10.515
ach tschuldigung, hatte zu spät geschnallt, daß du
eine onRollOver-schleife haben wolltest. aber jetzt hat
readme.txt ja schon die lösung gepostet.

gruß, gaspode
gaspode 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 08:49 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele