• beyond tellerrand – play. Register Now!
Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 30-08-2003, 14:23   #1 (permalink)
Flashaholic
 
Benutzerbild von atothek
 
Registriert seit: Feb 2003
Ort: Berlin
Beiträge: 1.459
Question create TF und create MC mit duplicate MC ???

Ich hab da ma ne Frage zu createTextField();
und zwar habe ich in einem MC ein TF erzeugt und dann will ich den MC duplizieren macht Flash auch aber nicht die TF`s die ich darin erzeugt habe WARUM ???

das Script sieht wie Folgt aus

ActionScript:
  1. function zeigeListen() {
  2.     createEmptyMovieClip("link_mc", 1);
  3.     with (_root.link_mc) {
  4.         beginFill(0xcccccc, 100);
  5.         lineStyle(1, 0x000000, 100);
  6.         lineTo(100, 0);
  7.         lineTo(100, 10);
  8.         lineTo(0, 10);
  9.         lineTo(0, 0);
  10.         endFill();
  11.         createTextField("titel_txt", 1, 0, -3, 90, 20);
  12.         titel_txt.selectable = false;
  13.         textForm = new TextFormat();
  14.         textForm.font = "Verdana";
  15.         textForm.size = 10;
  16.         titel_txt.setNewTextFormat(textForm);
  17.         titel_txt.text = "Testtext";
  18.     }
  19.     for (i=0; i<10; i++) {
  20.         duplicateMovieClip("link_mc", "link_mc"+i, 2+i);
  21.         this["link_mc"+i]._x = 50;
  22.         this["link_mc"+i]._y = 50+(this["link_mc"+i]._height+3)*i;
  23.         this["link_mc"+i].titel_txt.text = "Testtext";
  24.     }
  25. }
  26. zeigeListen()

keine Ahnung Warum das TF nicht mit dupliziert wurd obwohl es im MC erzeugt wird ????

Vielleicht hat ja Jemand eine Idee
__________________
TVNEXT Solutions
atothek ist offline   Mit Zitat antworten
Alt 30-08-2003, 14:41   #2 (permalink)
netTrek
 
Benutzerbild von netTrek
 
Registriert seit: Jul 2001
Ort: 46282 Dorsten
Beiträge: 2.972
Das funktioniert in der Tat nicht ???
Komisch einen Grund dafür habe ich jetzt auf anhieb auch nicht aber ich frage mich, warum du das Teil überhaupt duplizieren willst! Ich meine immerhin wird das Teil ja eh komplett dyn. erstellt! Warum also nicht per Schleife alle dyn. erstelllen?

SABAN
__________________
Saban Ünlü

netTrek GmbH & Co. KG
Softwareentwicklung, Design & Konzeption
www.netTrek.de
netTrek ist offline   Mit Zitat antworten
Alt 30-08-2003, 14:51   #3 (permalink)
Neuer User
 
Registriert seit: Jan 2002
Ort: Aachen
Beiträge: 1.081
hi,

Ist so. Alles was zur laufzeit in einen Mc gepackt wird (TF's,Mc's)
wird bei duplicate net mitgenommen.
Des Prob hatte ich auch ma, siehe hier :

attachMovie && duplicateMovieClip

Du brauchst einen Workaround, der die TF's nachträglich,
in den duplizierten mc erstellt.

ansatz : (untestet)
ActionScript:
  1. function zeigeListen() {
  2.         createEmptyMovieClip("link_mc", 1);
  3.         with (_root.link_mc) {
  4.                 beginFill(0xcccccc, 100);
  5.                 lineStyle(1, 0x000000, 100);
  6.                 lineTo(100, 0);
  7.                 lineTo(100, 10);
  8.                 lineTo(0, 10);
  9.                 lineTo(0, 0);
  10.                 endFill();
  11.                 createTextField("titel_txt", 1, 0, -3, 90, 20);
  12.                 titel_txt.selectable = false;
  13.                 textForm = new TextFormat();
  14.                 textForm.font = "Verdana";
  15.                 textForm.size = 10;
  16.                 titel_txt.setNewTextFormat(textForm);
  17.                 titel_txt.text = "Testtext";
  18.         }
  19.         for (i=0; i<10; i++) {
  20.                 duplicateMovieClip("link_mc", "link_mc"+i, 2+i);
  21.                 this["link_mc"+i]._x = 50;
  22.                 this["link_mc"+i]._y = 50+(this["link_mc"+i]._height+3)*i;
  23.                 this["link_mc"+i].titel_txt.text = "Testtext";
  24.                 with (this["link_mc"+i]) {
  25.                   createTextField("titel_txt", 1, 0, -3, 90, 20);
  26.                      titel_txt.selectable = false;
  27.                      textForm = new TextFormat();
  28.                      textForm.font = "Verdana";
  29.                   textForm.size = 10;
  30.                    titel_txt.setNewTextFormat(textForm);
  31.                      titel_txt.text = "Testtext";
  32.                    
  33.                  }
  34.         }
  35. }
  36. zeigeListen()

hoffe des hilft weida...
__________________
G.M. | working @ source lounge
georgexp ist offline   Mit Zitat antworten
Alt 30-08-2003, 14:52   #4 (permalink)
Flashaholic
 
Benutzerbild von atothek
 
Registriert seit: Feb 2003
Ort: Berlin
Beiträge: 1.459
Danke das ist ne Idee mit dem Workaround manchmal könnte es zu einfach sein !!!
@ netTrek

kein schlechter Hinweis muß ich ma schauen ob ich das so umsetzen kann das es für mich passt. Aber ansich schon eine Komische sache.
__________________
TVNEXT Solutions

Geändert von atothek (30-08-2003 um 14:54 Uhr)
atothek 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 03:48 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele