Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 18-05-2004, 12:56   #1 (permalink)
Neuer User
 
Registriert seit: Apr 2004
Ort: Haberloh
Beiträge: 49
Wo sind denn nun html Tags erlaubt?

Hallo Leute,

etwas ganz einfaches!

ein dynamisches Textfeld mit dem Instanznamen "txt"

soll auf der Datei texte1.txt
folgendes laden!

m.load("anzahl1.txt?rand="+random(9999), this);
texteladen = function () {
t = new LoadVars();
t.onLoad = function(jawoll) {
if (jawoll) {
for (var i = 0; i<=anzahl; i++) {
texte[i] = [];
texte[i].push(this["daten"+(i+1)]);
}
create();
}
};
t.load("2003-05-23/texte1.txt?rand="+random(9999), this);
};


nur ist das dynamische Textfeld etwas klein und er holt den text da ziemlich querbet rein!

wie bekomme ich nun zb eine neue Zeile (<br>, <p> geht ja nicht)
und natürlich mittig rechts- links- bündig!


Danke
Angehängte Dateien
Dateityp: zip texte1.zip (558 Bytes, 3x aufgerufen)
__________________
-=( keep cool )=-
............-- ' - -.
........_.'. __......' .
...-- (#) (#)--- /#\
.' @............../###\
:......... ,......./####
.' -..__.-'.._.- \###/
Oekel ist offline   Mit Zitat antworten
Alt 20-05-2004, 00:32   #2 (permalink)
agedoubleju
Gast
 
Beiträge: n/a
<br>- und <p>-Tags funzen doch wunderbar. Du musst nur das Textfeld bei den Eigenschaften auf HTML-fähig stellen oder die eingelesene Variable an die Textfieldeigenschaft _htmlText übergeben.
  Mit Zitat antworten
Alt 21-05-2004, 19:32   #3 (permalink)
Neuer User
 
Registriert seit: Apr 2004
Ort: Haberloh
Beiträge: 49
Danke!

aber leider zeigt er jetzt gar nichts mehr an!

Ich poste mal das Script!

stop();
texte = [];
maxb = display._width-75;
maxh = display._height-75;
verh = maxh/maxb;
textfarbe = new TextFormat();
textfarbe.color = 0x000000;
textfarbe.font = "ARIAL";
textfarbe.size = 16;
textfarbe.align = "center";
txt.backgroundColor = 0xCCCCCC;
txt.text = " Willkommen! Hier stehen gleich Infos zu den Bildern";
txt.setTextFormat(textfarbe);
m = new LoadVars();
m.onLoad = function(ok) {
if (ok) {
anzahl = Number(this.anzahl);
texteladen();
}
};
m.load("anzahl1.txt?rand="+random(9999), this);
texteladen = function () {
t = new LoadVars();
t.onLoad = function(jawoll) {
if (jawoll) {
for (var i = 0; i<=anzahl; i++) {
texte[i] = [];
texte[i].push(this["daten"+(i+1)]);
}
create();
}
};
t.load("2003-05-23/texte1.txt?rand="+random(9999), this);
};
MovieClip.prototype.paint = function(farbe, breite, hoehe, alpha) {
with (this) {
moveTo(0, 0);
lineStyle(0, farbe, 0);
beginFill(farbe, alpha);
lineTo(breite, 0);
lineTo(breite, hoehe);
lineTo(0, hoehe);
lineTo(0, 0);
endFill();
}
};
create = function () {
for (var i = 1; i<=anzahl; i++) {
mc = prev.holder.createEmptyMovieClip('holder'+i, -i);
mc._y = -25;
mc._x = (i-1)*58+4;
mc.loadMovie('2003-05-23/miniaturen/pic'+i+".jpg", 0);
prev.holder.onEnterFrame = function() {
if (this._width>0) {
for (var i = 1; i<=anzahl; i++) {
mc = this["holder"+i];
mc.id = i;
mc.onPress = function() {
display.createEmptyMovieClip("anzeige", 0);
display.anzeige.laden(this.id);
txt.text = texte[this.id-1];
txt.setTextFormat(textfarbe);
};
}
delete this.onEnterFrame;
}
};
}
};
MovieClip.prototype.moveleft = function(ziel, breite) {
if (this._x>(-breite+520)) {
this.onEnterFrame = function() {
this._x += (-this._x+ziel)*.3;
if (Math.round(this._x) == ziel) {
this._x = ziel-2;
delete this.onEnterFrame;
left.enabled = right.enabled=true;
}
};
} else {
left.enabled = right.enabled=true;
}
};
MovieClip.prototype.moveright = function(ziel, breite) {
if (this._x<-500) {
this.onEnterFrame = function() {
this._x += (-this._x+ziel)*.3;
if (Math.round(this._x) == ziel) {
this._x = ziel+2;
delete this.onEnterFrame;
left.enabled = right.enabled=true;
}
};
} else {
left.enabled = right.enabled=true;
}
};
MovieClip.prototype.posit = function() {
if (this._width<this._height) {
count = 0;
faktor = this._width/this._height;
} else {
count = 1;
faktor = this._height/this._width;
}
if (faktor == 1 && this._height>maxh) {
this._height = this._width=maxh;
}
if (faktor<1 && count == 1) {
if (faktor<verh) {
this._width = maxb;
this._height = this._width*faktor;
} else {
this._height = maxh;
this._width = this._height/faktor;
}
}
if (faktor<1 && count == 0) {
this._height = maxh;
this._width = this._height*faktor;
}
this._x = -this._width/2;
this._y = -this._height/2;
};
MovieClip.prototype.laden = function(id) {
this.createEmptyMovieClip("hold", 0);
this.createEmptyMovieClip("status", 1);
this.createEmptyMovieClip("texte", 2);
this.texte.createTextField("txt", 0, 0, -20, 200, 20);
this.hold.loadMovie("2003-05-23/pics/pic"+id+".jpg", 0);
this.texte._x = -100;
this.status.paint(0x000000, 200, 2, 100);
this.status._x = -100;
this.status.onEnterFrame = function() {
prozent = this._parent.hold.getBytesLoaded()/this._parent.hold.getBytesTotal()*100;
if (this._parent.hold.getBytesTotal()<=0) {
this._parent.texte.txt.text = "suche bild "+id;
} else {
this._parent.texte.txt.text = "lade bild "+id+" "+this._parent.hold.getBytesTotal()+" kb gesamt";
}
this._parent.texte.txt.setTextFormat(textfarbe);
if (this._parent.hold._width>0) {
this._parent.hold.posit();
this._parent.texte.removeMovieClip();
this.removeMovieClip();
} else {
this._xscale = prozent;
}
};
};
right_l.onRollOver = function() {
this.onEnterFrame = function() {
prev.holder._x<0 ? prev.holder._x += 4 : 0;//<-----die 10 ist die geschwindigkeit, anpassen
};
};
right_l.onRollOut = function() {
delete this.onEnterFrame;
};
left_l.onRollOver = function() {
breite = prev.holder._width;
this.onEnterFrame = function() {
prev.holder._x>-breite+53 ? prev.holder._x -= 4 : 0;//<-------breite +53 je nach laufweitenwunsch anpassen
};
};
left_l.onRollOut = function() {
delete this.onEnterFrame;
};
right_h.onRollOver = function() {
this.onEnterFrame = function() {
prev.holder._x<0 ? prev.holder._x += 15 : 0;//<-----die 10 ist die geschwindigkeit, anpassen
};
};
right_h.onRollOut = function() {
delete this.onEnterFrame;
};
left_h.onRollOver = function() {
breite = prev.holder._width;
this.onEnterFrame = function() {
prev.holder._x>-breite+53 ? prev.holder._x -= 15 : 0;//<-------breite +53 je nach laufweitenwunsch anpassen
};
};
left_h.onRollOut = function() {
delete this.onEnterFrame;
};
up.onPress = function() {
this.onEnterFrame = function() {
txt.scroll += 1;
};
};
up.onRelease = function() {
delete this.onEnterFrame;
};
down.onPress = function() {
this.onEnterFrame = function() {
txt.scroll -= 1;
};
};
down.onRelease = function() {
delete this.onEnterFrame;
};
Videos.onRelease = function() {
getURL("2003-05-23/Videos/Videos.html","_blank");
};
Download.onRelease = function() {
getURL("2003-05-23","_blank");
};



Es geht um den Text bei texte1.txt, den ich mal mit hochgeladen habe!

Guckt sich das mal einer an???
Danke
Angehängte Dateien
Dateityp: zip texte1.zip (558 Bytes, 2x aufgerufen)
__________________
-=( keep cool )=-
............-- ' - -.
........_.'. __......' .
...-- (#) (#)--- /#\
.' @............../###\
:......... ,......./####
.' -..__.-'.._.- \###/
Oekel ist offline   Mit Zitat antworten
Alt 22-05-2004, 00:46   #4 (permalink)
agedoubleju
Gast
 
Beiträge: n/a
Wie ich schon geschrieben habe: du musst deine Texte in die Textfeldeigenschaft htmlText und nicht in text einlesen, also z.B.:
ActionScript:
  1. txt.htmlText = " Willkommen! Hier stehen gleich Infos zu den Bildern";

Und dann tu uns bitte den Gefallen, wenn du Scripte hier im Forum veröffentlichst, die mit dem AS-Button mit AS-Tags zu umschliessen, damit die lesbar formatiert werden...
  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 13:42 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele