Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 17-10-2003, 13:39   #1 (permalink)
Kreativer Kopf
 
Benutzerbild von FlasherTyp
 
Registriert seit: Mar 2002
Ort: Darmstadt / Hessen
Beiträge: 1.120
2 Fragen an Fortgeschrittene AS Leute (Standart laden + setNewTextformat)

Hallo, hab folgendes Script:

ActionScript:
  1. System.useCodepage = true;
  2. MovieClip.prototype.funktionen = function() {
  3.     this.onPress = function() {
  4.         _root.kreistext = (_root['m'+this.id].kreistext);
  5.         _root.topic1 = (_root['m'+this.id].topic1);
  6.         _root.content1 = (_root['m'+this.id].content1).split("\n").join("");
  7.         _root.topic2 = (_root['m'+this.id].topic2);
  8.         _root.content2 = (_root['m'+this.id].content2).split("\n").join("");
  9.         _root.topic3 = (_root['m'+this.id].topic3);
  10.         _root.content3 = (_root['m'+this.id].content3).split("\n").join("");
  11.         _root.topic4 = (_root['m'+this.id].topic4);
  12.         _root.content4 = (_root['m'+this.id].content4).split("\n").join("");
  13.         _root.topic5 = (_root['m'+this.id].topic5);
  14.         _root.content5 = (_root['m'+this.id].content5).split("\n").join("");
  15.         _root.topic6 = (_root['m'+this.id].topic6);
  16.         _root.content6 = (_root['m'+this.id].content6).split("\n").join("");
  17.         _root.topic7 = (_root['m'+this.id].topic7);
  18.         _root.content7 = (_root['m'+this.id].content7).split("\n").join("");
  19.         _root.topic8 = (_root['m'+this.id].topic8);
  20.         _root.content8 = (_root['m'+this.id].content8).split("\n").join("");
  21.         _root.topic9 = (_root['m'+this.id].topic9);
  22.         _root.content9 = (_root['m'+this.id].content9).split("\n").join("");
  23.         _root.topic10 = (_root['m'+this.id].topic10);
  24.         _root.content10 = (_root['m'+this.id].content10).split("\n").join("");
  25.     };
  26. };
  27. function flaggen(ziel, xpos, i) {
  28.     var flagge = _root.createEmptyMovieClip('flagge'+i, i);
  29.     var controll = _root.createEmptyMovieClip('controll'+i, i+1000);
  30.     flagge._y = 10;
  31.     flagge._x = xpos+5;
  32.     flagge.loadMovie(ziel);
  33.     controll.onEnterFrame = function() {
  34.         if (flagge._width>0) {
  35.             delete this.onEnterFrame;
  36.             delete (this);
  37.             flagge.id = i;
  38.             flagge.funktionen();
  39.         }
  40.     };
  41. }
  42. sprachenladen = new LoadVars();
  43. sprachenladen.onLoad = function(erfolgreich) {
  44.     if (erfolgreich) {
  45.         arrSprachen = this.sprachdateien.split("|");
  46.         for (var i = 0; i<arrSprachen.length-1; i++) {
  47.             _root['m'+i] = new LoadVars();
  48.             _root['m'+i].id = i;
  49.             _root['m'+i].onLoad = function(ok) {
  50.                 if (ok) {
  51.                     flaggen(this.flag.substr(0, -2), this.id*25, this.id);
  52.                 }
  53.             };
  54.             _root['m'+i].load('sprachen/'+arrSprachen[i]);
  55.         }
  56.     } else {
  57.         trace("Fehler Sprachdaten");
  58.     }
  59. };
  60. sprachenladen.load("sprachen.txt");

Nach abarbeitung springt er zu Bild 2 und wartet bis man eine Flagge gedrückt hat bis er eine Sprachdatei lädt. Was muss ich in dem obrigen Script denn ändern damit er als Standart solange nicht gedrückt wurde die german.txt lädt ?
__________________
Life is Pain
FlasherTyp ist offline   Mit Zitat antworten
Alt 17-10-2003, 13:41   #2 (permalink)
Kreativer Kopf
 
Benutzerbild von FlasherTyp
 
Registriert seit: Mar 2002
Ort: Darmstadt / Hessen
Beiträge: 1.120
So und nun das zweite Problem. In Bild 2 habe ich ein Movie indem folgendes Script auftaucht:

ActionScript:
  1. centerx = 0;
  2. centery = 0;
  3. textformat = new TextFormat();
  4. textformat.font = "Times New Roman";
  5. textformat.color = "0xFFFFFF";
  6. textformat.size = "14";
  7. radius = 330;
  8. this.createTextField("control", 500, 0, 0, 500, 100);
  9. mein_text = _root.kreistext;
  10. control.setNewTextFormat(textformat);
  11. control.embedFonts = true;
  12. control.text = mein_text;
  13. trace(_root.kreistext);
  14. while (control.textWidth<radius) {
  15.     mein_text += "=";
  16.     control.text = mein_text;
  17. }
  18. text_array = mein_text.split("");
  19. gesamt = control.textWidth;
  20. for (i=1; i<=text_array.length; i++) {
  21.     control.text = mein_text.substring(0, i-1);
  22.     abschnitt = control.textWidth/gesamt*Math.PI/2;
  23.     for (j=0; j<4; j++) {
  24.         this.createEmptyMovieClip("t"+i+"_"+j, i+j*100);
  25.         this["t"+i+"_"+j].createTextField("textfeld", 1, 0, 0, 20, 20);
  26.         this["t"+i+"_"+j]._x = radius*Math.sin(-abschnitt-j*Math.PI/2)+centerx;
  27.         this["t"+i+"_"+j]._y = radius*Math.cos(abschnitt+j*Math.PI/2)+centery;
  28.         this["t"+i+"_"+j].textfeld.embedFonts = true;
  29.         this["t"+i+"_"+j]._rotation = (abschnitt+j*Math.PI/2)/Math.Pi*180-180;
  30.         this["t"+i+"_"+j].textfeld.setNewTextFormat(textformat);
  31.         this["t"+i+"_"+j].textfeld.text = text_array[i-1];
  32.         this["t"+i+"_"+j].textfeld._y = this["t"+i+"_"+j].textfeld.textHeight/2;
  33.     }
  34.     control.text = "";
  35. }

Aber er lädt den Text nicht rein? Wie bekomme ich das hin, so das auch bei einer Sprachauswahl (siehe erstes posting) dieser "Kreistext" wieder angepasst wird???
__________________
Life is Pain
FlasherTyp ist offline   Mit Zitat antworten
Alt 17-10-2003, 13:48   #3 (permalink)
Neuer User
 
Registriert seit: Jun 2001
Ort: Stuttgart
Beiträge: 6.415
problem2: der kreistext is in deiner ausführugn noch garnicht dynamisch
wieso lieferst du diesen text nicht über die txt datei mit
dann kannste du sie aus deinem sprachenladen reinladen(dieser ist ja je nachdem engl oder deutsch etc)

problem1:
wenn du als standard deutsch laden willst
dann mache es doch so:
2.sprachcontainer
von namen

"deutsch" zB

in diesen arbeitest du parallel zu anderen sprachen
wenn der user nun deutsch auswählt
dann benutzt nicht den sprachcontainer sondern diesen deutschen container.
denn die unfertigen daten von da nach da zu kopieren geht nicht.


du musst verstehen dass ich mich nicht wirklich in den code reinarbeiten wollte
daher ne theoretische statt praktische ausführung

deluxe
Deluxe ist offline   Mit Zitat antworten
Alt 17-10-2003, 14:38   #4 (permalink)
Kreativer Kopf
 
Benutzerbild von FlasherTyp
 
Registriert seit: Mar 2002
Ort: Darmstadt / Hessen
Beiträge: 1.120
doch ist er, der text der auf dem kreis auftaucht ist _root.kreistext

allerdings geht das nicht mehr seitdem ich diese sprachauswahl drinne habe, als ich vorher in bild 1 einfach nur eine sprachdatei geladen habe lief es.

das mit dem sprachcontainer überstieg meinen horizont :-(
__________________
Life is Pain

Geändert von FlasherTyp (17-10-2003 um 14:39 Uhr)
FlasherTyp ist offline   Mit Zitat antworten
Alt 23-10-2003, 07:51   #5 (permalink)
Kreativer Kopf
 
Benutzerbild von FlasherTyp
 
Registriert seit: Mar 2002
Ort: Darmstadt / Hessen
Beiträge: 1.120
Servus also Problem eins mit ne Standatrwahl hab ich gelöst, allerdings brauch ich wirklich hilfe zu problem2, warum lädt er den dynamisch eingeladenen text nicht auf den kreis?
__________________
Life is Pain
FlasherTyp ist offline   Mit Zitat antworten
Alt 24-10-2003, 05:55   #6 (permalink)
Kreativer Kopf
 
Benutzerbild von FlasherTyp
 
Registriert seit: Mar 2002
Ort: Darmstadt / Hessen
Beiträge: 1.120
hülfe :-(

keiner ne ahnung???
__________________
Life is Pain
FlasherTyp 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 20:07 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele