Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 06-09-2003, 15:15   #1 (permalink)
Steffen G.
 
Benutzerbild von Tschdaeff
 
Registriert seit: Aug 2001
Ort: Ba-Wü
Beiträge: 4.123
onEnterFrame gehen nicht

hi kann mir jemand sagen warum kein onEnterFrame ausgeführt wird?

ActionScript:
  1. _root.createEmptyMovieClip("load_controller",9999)
  2. thumbs_loader = new LoadVars();
  3. thumbs_loader.load("thumbs.txt");
  4. thumbs_loader.onLoad = function() {
  5.     thumbs_arr = this.thumbs_index.split(";");
  6. };
  7.  
  8. thumbs_arr_check = function () {
  9.     if (thumbs_arr != undefined) {
  10.         return 1;
  11.     } else {
  12.         return 0;
  13.     }
  14. };
  15.  
  16. loader_class = function () {};
  17. loader_class.prototype = new MovieClip();
  18. loader_class.prototype.frame = function() {
  19. //trace (typeof(this)) das gibt "movieclip" aus
  20.     this.onEnterFrame = function () { // geht nicht
  21.         trace ("gfh")
  22.        
  23.     }
  24. }
  25. loader_class.prototype.loader = function(id) {
  26.     this.loadMovie(id);
  27.     this.frame ()
  28. /*this.onEnterFrame = function () { // geht nicht
  29.         trace ("aa") 
  30.        
  31.     }
  32.        
  33.         this.gel = this.getBytesLoaded ()
  34.         this.zul = this.getBytesTotal ()
  35.         this.per = Math.round(this.gel/this.zul*100)
  36.         trace (this.per)
  37.         if (this.per == 100) {
  38.             trace ("ja")
  39.             delete this.onEnterFrame;
  40.             _root.thumbs_cont_zahl++
  41.             trace (_root.thumbs_cont_zahl)
  42.             _root["thumbs_cont"+_root.thumbs_cont_zahl].loader(thumbs_arr[_root.thumbs_cont_zahl]);
  43.         }
  44.         */
  45. };
  46. controll = function () {};
  47. controll.prototype.anordnen = function() {
  48.     for (var i=0; i<5; i++) {
  49.             _root.attachMovie("thumbs_cont", "thumbs_cont"+i, i+5);
  50.             obj = _root["thumbs_cont"+i];
  51.             obj._x = 630;
  52.             obj._y = 20+i*110;
  53.             obj.__proto__ = new loader_class();
  54.             obj.loader (thumbs_arr[i])
  55.     }
  56. };
  57.  
  58. load_controller.onEnterFrame = function () {
  59.     if (thumbs_arr_check () != 0) {
  60.         controller = new controll ();
  61.         controller.anordnen ();
  62.         delete this.onEnterFrame;
  63.     }
  64. }

ich hoffe das kann mir jemand erklären

kann auch sein das ich den wald vor lauter bäumen nicht sehe

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

Tschdaeff ist offline   Mit Zitat antworten
Alt 06-09-2003, 15:18   #2 (permalink)
Revived @ Sunday
 
Benutzerbild von MacEvil
 
Registriert seit: Apr 2003
Ort: Nowhereland
Beiträge: 3.244
Was passiert so ?
ActionScript:
  1. if (load_controller) {
  2. load_controller.onEnterFrame = function () {
  3.         if (thumbs_arr_check () != 0) {
  4.                 controller = new controll ();
  5.                 controller.anordnen ();
  6.                 delete this.onEnterFrame;
  7.         }
  8. }
  9. }else {
  10. trace("Dimmt nit");
  11. }
MacEvil ist offline   Mit Zitat antworten
Alt 06-09-2003, 15:22   #3 (permalink)
Steffen G.
 
Benutzerbild von Tschdaeff
 
Registriert seit: Aug 2001
Ort: Ba-Wü
Beiträge: 4.123
ups hab ich vergessen zu sagen... also der unterste geht

load_controller.onEnterFrame ist ok

der ist nur dazu da das die anderen aktionen erst ausgeführ
werden wenn die daten aus dem loadobjekt da sind...

aber

ActionScript:
  1. loader_class.prototype.frame = function() {
  2.         //trace (typeof(this)) das gibt "movieclip" aus
  3.         this.onEnterFrame = function () { // geht nicht
  4.                 trace ("gfh")
  5.                
  6.         }
  7. }

der geht nicht... wenn ich was vor das

ActionScript:
  1. this.onEnterFrame = function () {

setze wird es ausgeführt... aber der onEnterFrame wird nicht ausgeführt

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

Tschdaeff ist offline   Mit Zitat antworten
Alt 06-09-2003, 16:27   #4 (permalink)
helpQLODhelp
 
Benutzerbild von bokel
 
Registriert seit: Feb 2002
Ort: Köln
Beiträge: 8.505
Ein MovieClip besteht aus zwei Teilen, dem MovieClip-Objekt in Actionscript und einem korrespondierenden Objekt innerhalb des Flashplayers. Das Actionscript-Objekt ist nur die Schnittstelle, um auf das interne Objekt per Actionscript zugreifen zu können.

Einen kompletten MovieClip kannst du in Flash nur mit createEmptyMovieClip, attachMovie, duplicateMovie oder über die Timeline erzeugen. Mit new wird lediglich das Actionscript-Objekt erzeugt, aber nicht das interne Objekt.

In deinem Fall fehlt einfach das interne Objekt. Ohne das kannst du keine Eigenschaften und Event-Handler eines MovieClips benutzen.

Anstatt onEnterFrame, was für einen Loader sowieso viel zu haeufig aufgerufen wird, würde ich einfach setInterval benutzen.

mfg r.
bokel ist offline   Mit Zitat antworten
Alt 06-09-2003, 20:39   #5 (permalink)
Steffen G.
 
Benutzerbild von Tschdaeff
 
Registriert seit: Aug 2001
Ort: Ba-Wü
Beiträge: 4.123
hmm aber ich attache doch movieclips das geht ja auch

ActionScript:
  1. controll.prototype.anordnen = function() {
  2.         for (var i=0; i<5; i++) {
  3.                 _root.attachMovie("thumbs_cont", "thumbs_cont"+i, i+5);
  4.                 obj = _root["thumbs_cont"+i];
  5.                 obj._x = 630;
  6.                 obj._y = 20+i*110;
  7.                 obj.__proto__ = new loader_class();
  8.                 obj.loader (thumbs_arr[i])
  9.         }
  10. };

nur die onEnterFrames greifen net

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

Tschdaeff ist offline   Mit Zitat antworten
Alt 06-09-2003, 20:46   #6 (permalink)
helpQLODhelp
 
Benutzerbild von bokel
 
Registriert seit: Feb 2002
Ort: Köln
Beiträge: 8.505
Oh ja, jetzt sehe ich es auch

Du kannst einem MovieClip keine Events zuweisen, bevor er nicht geladen ist.

mfg .r
bokel 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:18 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele