{lang: 'de'}
Flashhilfe.de - Flash Community

Prototype: duplicate TextField [Flash 8]

 


AntwortenRegistrieren Seite1  

abgemeldeter Benutzer#1
08.06.2004, 12:34

TextField.duplicate()

Prototype:
ActionScript:
1
2
3
4
5
6
7
TextField.prototype.duplicate = function (instanceName:String, depth:Number) {
     this._parent.createTextField(instanceName, depth, this._x, this._y, this._width, this._height);
     this._parent[instanceName].setNewTextFormat(this.getTextFormat());
     for(var i in this) if(i != 'variable') this._parent[instanceName][i] = this[i];
     return this._parent[instanceName];
}
ASSetPropFlags(TextField.prototype, "duplicate", 1);


Beispiel Aufruf:
ActionScript:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* wichtig : nicht vergessen eure font in die libary zu übernehmen und
* für as freizugeben sonst seht ihr kein text !
*/


// _root.mytf als vorhandenes textfeld vorrausgesetzt

_root.mytf.duplicate("tf2", 0);
_root.tf2._y = _root.tf2._y + 30;
_root.tf2.textColor = 0xff0000;
_root.tf2.text = "my new text!";

_root.mytf.duplicate("tf3", 1);
_root.tf3._y = _root.tf3._y + 60;
_root.tf3.textColor = 0x0000ff;
Schlagwörter: duplicate, prototype, textfield

AntwortenRegistrieren Seite1  

Schnellantwort

Du musst registriert sein, um diese Funktion nutzen zu können.

 
Ähnliche Beiträge zum Thema
Partner Webseiten: art-and-law.de  Mediengestalter.info   phpwelt.de   Scubacube.de  
Haftungsausschluss   Datenschutzerklärung   Impressum
© 1999-2024 Sebastian Wichmann - Flashhilfe.de