Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 01-08-2003, 18:13   #1 (permalink)
...
 
Registriert seit: Oct 2002
Ort: Nürnberg
Beiträge: 3.611
skalierungs-prob

hi,
hab grad einen kl. prototype zum laden externen jpg's geschrieben. jedoch ist irgendwas faul mit dem textfeld. ohne textfeld geht alles wunderbar, mit wird der mc uebergross skaliert
ActionScript:
  1. MovieClip.prototype.loadPic = function(pic, width_Value, height_Value) {
  2.     this.createTextField("loader_txt", 1, 0, 0, 100, 20);
  3.     this.loader_txt.text = "lade";
  4.     this.createEmptyMovieClip("dummy", 2);
  5.     this.dummy.loadMovie("pics/"+pic);
  6.     this.onEnterFrame = function() {
  7.         if (this._width>0) {
  8.             this._width = width_Value;
  9.             this._height = height_Value;
  10.             delete this.onEnterFrame;
  11.             this.loader_txt.removeTextField();
  12.         }
  13.     };
  14. };
  15. // Aufruf
  16. this.createEmptyMovieClip("holder", 10);
  17. holder.loadPic("bild.jpg", 100, 100);
Edit: hat wohl was mit dem delete onenterFrame zu tun...
wenn ich es weglasse gehts

Geändert von thorben.schmitt (01-08-2003 um 18:15 Uhr)
thorben.schmitt ist offline   Mit Zitat antworten
Alt 01-08-2003, 18:54   #2 (permalink)
Herr Brot
 
Benutzerbild von mati
 
Registriert seit: Dec 2002
Beiträge: 1.692
@hnes: aus deinem post werde ich nicht schlau.

@thorben:
versuch mal als erstes das delete this.onEnterFrame reinzumachen, würd ich jetzt so rein intuitiv machen. sonst seh ich keinen fehler.


gruß, mati
__________________
„Ich war geheilt, all right!“
mati ist offline   Mit Zitat antworten
Alt 01-08-2003, 18:58   #3 (permalink)
...
 
Registriert seit: Oct 2002
Ort: Nürnberg
Beiträge: 3.611
hab schon alle varianten getestet, vielleicht ein bug?

egal, habs jetzt ohne text geloest.

danke dir trotzdem
thorben.schmitt ist offline   Mit Zitat antworten
Alt 01-08-2003, 19:03   #4 (permalink)
Herr Brot
 
Benutzerbild von mati
 
Registriert seit: Dec 2002
Beiträge: 1.692
hat der hnes seinen post jetzt wieder gelöscht?

thorben, hast du's auch schon mit BytesLoaded() und Total() versucht, oder willst du das unbedingt vermeiden?
__________________
„Ich war geheilt, all right!“
mati ist offline   Mit Zitat antworten
Alt 01-08-2003, 19:06   #5 (permalink)
Herr Brot
 
Benutzerbild von mati
 
Registriert seit: Dec 2002
Beiträge: 1.692
@thorben:

ActionScript:
  1. if (this.dummy._width>0) {

dann funktionierts bei mir. dürfte aber meiner meinung nach keinen unterschied machen, tut es aber.


so far, mati
__________________
„Ich war geheilt, all right!“
mati ist offline   Mit Zitat antworten
Alt 01-08-2003, 19:14   #6 (permalink)
...
 
Registriert seit: Oct 2002
Ort: Nürnberg
Beiträge: 3.611
auch hir nochmal thx
thorben.schmitt ist offline   Mit Zitat antworten
Alt 01-08-2003, 21:58   #7 (permalink)
{flasher}
 
Benutzerbild von Majo
 
Registriert seit: Mar 2003
Ort: on water
Beiträge: 2.823
hier mal noch ein script vom bokel, das ich noch ein wenig abgeändert hab
ActionScript:
  1. Movieclip.prototype.lM = function(url, onLoad, onLoadParms){
  2.     var mc = this.createEmptyMovieclip("looper", 1040000-1);
  3.         mc.exec = onLoad;
  4.         mc.execParms = onLoadParms;  
  5.         mc.onEnterFrame = function(){
  6.                 this._parent.updateStatus(this._parent.holder);
  7.                 with (this._parent.holder) {
  8.                         if (_width > 0 && _height > 0) {
  9.                             this.exec.apply(this._parent.holder, this.execParms);
  10.                             this.removeMovieClip()
  11.                         }
  12.                 }
  13.         };
  14.         mc = this.createEmptyMovieclip("holder", 1040000-2);
  15.         mc.loadMovie(url, method);
  16. };
  17. ASSetPropFlags(Movieclip.prototype, ["loadMovieWithOnLoad"], 1);
  18. Movieclip.prototype.updateStatus = function(mc, derText){   
  19.         if(mc.percentage == undefined){
  20.                 //textfeld fuer die anzeige der prozentzahl erzeugen
  21.                 this.createTextField("percent", 1040000-3, mc._x, mc._y+25, 100, 100);
  22.                 this.percent.autoSize = true;
  23.                 this.createEmptyMovieClip("ladebalken",104000-4);
  24.         };
  25.         var derText = this.bildtext;
  26.         var bl = mc.getBytesLoaded() || 0;
  27.         var bt = mc.getBytesTotal() || 1;
  28.         var percentage = Math.round(bl * 100 / bt);
  29.         this.percent.textColor = 0x0000ff;
  30.         this.percent.text = percentage+" %"; //prozent als text anzeigen
  31.         this.clear();                   //prozent als schwarze linie anzeigen
  32.         this.lineStyle(0);
  33.         this.ladebalken.moveTo(this.percent._x, this.percent._y);
  34.         this.ladebalken.lineTo(50+this.percent._x, this.percent._y);
  35.         this.ladebalken.lineStyle(1,0xff0000);
  36.         this.ladebalken.moveTo(this.percent._x, this.percent._y)
  37.         this.ladebalken.lineTo((percentage/2)+this.percent._x, this.percent._y);
  38.         if(percentage == 100){
  39.             this.percent.removeTextField();
  40.             this.ladebalken.clear();
  41.         };
  42. };
  43. function mcSetSize(x, y, w, h) {
  44.     this._x = x;
  45.     this._y = y;
  46.     this._width = w;
  47.     this._height = h;   
  48.    
  49. };
__________________
hang loose

Geändert von Majo (01-08-2003 um 22:00 Uhr)
Majo 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 05:38 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele