Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 27-10-2005, 10:04   #1 (permalink)
Neuer User
 
Registriert seit: Jun 2002
Ort: Dorsten
Beiträge: 382
dateipfade von director an flashfilm übergeben

ich habe eine director-anwendung, die via Buddy API ein fenster öffnet und einen dateipfad liefert.

Unter Windows also z.B.
C:\Test\Hägar der Schreckliche\

Unter MacOS also z.B.
Macintosh HD:Test:Hägar der Schreckliche:

Jetzt möchte ich diesen Pfad valid an Flash übergeben und wandel ihn vorher via Lingo um in:

file:///Macintosh%20HD/Test/Hägar%20der%20Schreckliche/
file://C|/Test/Hägar%20der%20Schreckliche/

wenn ich die Variable aber an Flash übergebe (via sprite(1).setVariable("pfad", pfad)) kommt auf dem Mac folgendes über:

file:///Macintosh%20HD/Test/HŠgar%20der%20Schreckliche/

aus diesem Grund lädt er die entsprechende Datei nicht. Anscheinend hat entweder Director(10) oder Flash(7) auf dem Mac eine fehlerhafte/unterschiedliche Codierung von Umlauten. Wie kann ich das umgehen bzw. konvertieren?
__________________
No reason to live but i like it this way.

Geändert von timoken (27-10-2005 um 10:11 Uhr)
timoken ist offline   Mit Zitat antworten
Alt 27-10-2005, 11:13   #2 (permalink)
Neuer User
 
Registriert seit: Jun 2002
Ort: Dorsten
Beiträge: 382
habe mir jetzt nen lingo-konvertierungsscript gebaut weil in flash keine brauchbaren daten mehr ankommen aber optimal ist das nicht (sind nur die gängigsten deutschen umlaute!)

LINGO:
ActionScript:
  1. global separator
  2.   separator = the last char of the moviepath
  3.  
  4. on fla2dir filepath
  5.   global separator
  6.   filepath = str_replace("file:///", "", filepath)
  7.   filepath = str_replace("/", separator, filepath)
  8.   filepath = str_replace("|", ":", filepath)
  9.   filepath = str_replace("%20", " ", filepath)
  10.   --Mac-Umlautkonvertierung
  11.   if separator = ":" then
  12.     filepath = str_replace(NumtoChar(228), NumtoChar(138), filepath)
  13.     filepath = str_replace(NumtoChar(246), NumtoChar(154), filepath)
  14.     filepath = str_replace(NumtoChar(252), NumtoChar(159), filepath)
  15.     filepath = str_replace(NumtoChar(223), NumtoChar(167), filepath)
  16.     filepath = str_replace(NumtoChar(196), NumtoChar(128), filepath)
  17.     filepath = str_replace(NumtoChar(214), NumtoChar(133), filepath)
  18.     filepath = str_replace(NumtoChar(220), NumtoChar(134), filepath)
  19.   end if
  20.   return filepath
  21. end
  22.  
  23. on dir2fla filepath
  24.   global separator
  25.   filepath = str_replace(separator, "/", filepath)
  26.   filepath = str_replace(":", "|", filepath)
  27.   filepath = str_replace(" ", "%20", filepath)
  28.   filepath = "file:///" & filepath
  29.   --Mac-Umlautkonvertierung
  30.   if separator = ":" then
  31.     filepath = str_replace(NumtoChar(138), NumtoChar(228), filepath)
  32.     filepath = str_replace(NumtoChar(154), NumtoChar(246), filepath)
  33.     filepath = str_replace(NumtoChar(159), NumtoChar(252), filepath)
  34.     filepath = str_replace(NumtoChar(167), NumtoChar(223), filepath)
  35.     filepath = str_replace(NumtoChar(128), NumtoChar(196), filepath)
  36.     filepath = str_replace(NumtoChar(133), NumtoChar(214), filepath)
  37.     filepath = str_replace(NumtoChar(134), NumtoChar(220), filepath)
  38.   end if
  39.   return filepath
  40. end
__________________
No reason to live but i like it this way.
timoken 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:37 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele