Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 27-11-2006, 09:28   #1 (permalink)
Neuer User
 
Benutzerbild von offense
 
Registriert seit: Nov 2003
Ort: MS
Beiträge: 31
Lightbulb wmode transparent + Alt Gr (@) = Problem

Hallo Zusammen,

hier eine Lösung für ein altbekanntes Problem welches hier und woanders schon öfters besprochen wurde.

Wenn der wmode=transparent gesetzt wurde, kann man im Firefox kein @/at mehr nutzen. Dies ist wohl ein generelles Alt GR Problem. Hier ist ein kleines Action Script welches dieses Problem löst:

PHP-Code:
os System.capabilities.os;
if (
os.substr(03) == "Win") {
   
trace(":: INIT ALTGRBUG ::");
altGrBug = {};
// listener object
altGrBug.false;
altGrBug.false;
altGrBug.selB = -1;
// for selection begin, end und target
altGrBug.selE = -1;
altGrBug.selT null;
altGrBug.replace = {_113:"@"_101:"?"_50:"²"_51:"³"_55:"{"_56:"["_57:"]"_48:"}"_223:"\\"_43:"~"_109:"µ"_60:"|"};
// hope this are all altgr-codes
altGrBug.onKeyDown = function() {
   if (
Key.getCode() == Key.ALT) {
       
this.true;
   }
   if (
Key.getCode() == Key.CONTROL) {
       
this.true;
   }
   if (
this.&& this.&& this.selT == null) {
       
// get selection
       
this.selT Selection.getFocus();
       
this.selB Selection.getBeginIndex();
       
this.selE Selection.getEndIndex();
   }
};
altGrBug.onKeyUp = function() {
   if (
this.&& this.c) {
       var 
char this.replace["_"+Key.getAscii()];
       
// find character to use
       
if (char.length == 1) {
           if (
typeof (eval(this.selT)) == "object") {
               
// only if target is a textfield;
               
trace("'"+char+"' added");
               eval(
this.selT).text = eval(this.selT).text.substr(0this.selB)+char+eval(this.selT).text.substr(this.selE+1);
               
this.selB++;
               
this.selE this.selB;
           }
           
Selection.setFocus(this.selT);
           
// restore focus and selection
           
Selection.setSelection(this.selBthis.selB);
       } else {
           
// if altgr is released
           
this.false;
           
this.false;
           
this.selB = -1;
           
this.selE = -1;
           
this.selT null;
       }
   }
};
Key.addListener(altGrBug);


Grüße aus Münster/Telgte


PS an Sascha: Was sollte eigentlich der Kommentar auf der FFK, das Ost-Westfalen ein schlimmes Pflaster wäre? Ich arbeite doch nur in Telgte und wohne in Münster. Aber danke für die Gewinne
__________________
Ich bin voller Gedanken und äussere daher nicht immer den Richtigen.
www.offense.de

Geändert von offense (27-11-2006 um 09:29 Uhr)
offense 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 13:40 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele