Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 01-07-2004, 10:03   #1 (permalink)
The Man Who Wasn't There
 
Benutzerbild von fraggle two
 
Registriert seit: Jul 2003
Ort: BÄRLIN
Beiträge: 1.156
createEmptyMovieClip() bei dyn. mc's

guten morgen,

ich will dyn. mc's laden.
dazu das folgende script:

ActionScript:
  1. pics = 5;
  2. MovieClip.prototype.bilder_laden = function(anzahl, zeilen) {
  3.     for (i=1; i<=anzahl; i++) {
  4.         this.createEmptyMovieClip("mc"+i, i+1);
  5.         this["mc"+i].loadMovie("0"+i+".swf");
  6.         this["mc"+i].createEmptyMovieClip("rahmen", i+1) // hier macht es nix???
  7.                 if (i == 1) {
  8.             this["mc"+i]._x = 15;
  9.             this["mc"+i]._y = 15;
  10.         } else if (i<=zeilen) {
  11.             this["mc"+i]._x = this["mc"+(i-1)]._x+85;
  12.             this["mc"+i]._y = this["mc"+(i-1)]._y;
  13.         } else {
  14.             this["mc"+i]._x = this["mc"+(i-1)]._x-((zeilen-1)*85);
  15.             this["mc"+i]._y = this["mc"+(i-1)]._y+85;
  16.             zeilen += zeilen;
  17.         }
  18.     }
  19. };
  20. this.bilder_laden(pics, 4);
  21. stop();

warum erstellt es mir keine neuen mc's an der kommentierten stelle?
weil da schon das .swf liegt?
gruß und danke
mike
__________________
Dot-Realities
Mike Broders
Berlin

ICQ:105925103

Dot-Realities v4.0 under construction!

Geändert von fraggle two (01-07-2004 um 10:04 Uhr)
fraggle two ist offline   Mit Zitat antworten
Alt 01-07-2004, 10:49   #2 (permalink)
agedoubleju
Gast
 
Beiträge: n/a
Setz mal vor die Erstellung des Rahmen-MC einen Mini-Preloader, z.B.

PHP-Code:
this.createEmptyMovieClip("mc"+ii+1); 
this["mc"+i].loadMovie("0"+i+".swf"); 

_level0.onEnterFrame = function(){//prüfe laufend... 
   
var ende int(_level0["mc"+i].getBytesLoaded()*100/_level0["mc"+i].getBytesTotal()); 

   
//alles geladen und die Bounds sind gesetzt 
   
if(ende>=100 && _level0["mc"+i]._width>&& _level0["mc"+i]._height>0) {
      
delete _level0.onEnterFrame;//den Event wieder löschen 
      
_level0["mc"+i].createEmptyMovieClip("rahmen"i+1);
      
//etc.
   



Geändert von agedoubleju (01-07-2004 um 11:15 Uhr)
  Mit Zitat antworten
Alt 01-07-2004, 11:10   #3 (permalink)
The Man Who Wasn't There
 
Benutzerbild von fraggle two
 
Registriert seit: Jul 2003
Ort: BÄRLIN
Beiträge: 1.156
hmmm...

da tut sich garnix...

trotzdem danke...

gruß
mike
__________________
Dot-Realities
Mike Broders
Berlin

ICQ:105925103

Dot-Realities v4.0 under construction!
fraggle two ist offline   Mit Zitat antworten
Alt 01-07-2004, 11:13   #4 (permalink)
The Man Who Wasn't There
 
Benutzerbild von fraggle two
 
Registriert seit: Jul 2003
Ort: BÄRLIN
Beiträge: 1.156
ahhhh....

da waren die unterstriche von _width und _height irgendwie geschluckt.

jetzt komm ich der sache schon näher...

gruß
mike
__________________
Dot-Realities
Mike Broders
Berlin

ICQ:105925103

Dot-Realities v4.0 under construction!
fraggle two ist offline   Mit Zitat antworten
Alt 01-07-2004, 12:07   #5 (permalink)
The Man Who Wasn't There
 
Benutzerbild von fraggle two
 
Registriert seit: Jul 2003
Ort: BÄRLIN
Beiträge: 1.156
sooo...

leere mc's kann ich ja schonmal erzeugen.
wenn ich jetzt aber diesen mc's ein movie attachen will geht das wieder nicht.(auskommentierte zeile)

ActionScript:
  1. pics = 5;
  2. MovieClip.prototype.bilder_laden = function(anzahl, zeilen) {
  3.     zeilen1 = zeilen;
  4.     for (i=1; i<=anzahl; i++) {
  5.         var clip = this.createEmptyMovieClip("mc"+i, i+1);
  6.         clip.loadMovie("0"+i+".swf");
  7.         if (i == 1) {
  8.             clip._x = 15;
  9.             clip._y = 15;
  10.         } else if (i<=zeilen) {
  11.             clip._x = this["mc"+(i-1)]._x+85;
  12.             clip._y = this["mc"+(i-1)]._y;
  13.         } else {
  14.             clip._x = this["mc"+(i-1)]._x-((zeilen1-1)*85);
  15.             clip._y = this["mc"+(i-1)]._y+85;
  16.             zeilen += zeilen1;
  17.         }
  18.     }
  19.     this.onEnterFrame = function() {
  20.         if (this["mc"+anzahl]._width != 0) {
  21.             delete this.onEnterFrame;
  22.             for (i=1; i<=anzahl; i++) {
  23.                  this["mc"+i].createEmptyMovieClip("rahm", 1);
  24.                                          //this["mc"+i].rahm.attachMovie("pic_rahmen", "pic_rahmen", 1);
  25.  
  26.             }
  27.         }
  28.     };
  29. };
  30. this.bilder_laden(pics, 3);
  31. stop();

was ist da los?

gruß
mike
__________________
Dot-Realities
Mike Broders
Berlin

ICQ:105925103

Dot-Realities v4.0 under construction!
fraggle two 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 01:40 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele