Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 20-02-2005, 22:32   #1 (permalink)
Neuer User
 
Registriert seit: Sep 2004
Beiträge: 888
Question von einem textfeld den alpha wert definieren?

hi ich wollte wissen woe man in ActionScript den alpha wert eines textfeldes definieren kann?
flozwo ist offline   Mit Zitat antworten
Alt 20-02-2005, 22:49   #2 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
statischer text: gar nicht;außer man inkludiert es in ein mc und gibt dem mc einen alphawert

dynamisches textfeld:schriftart einbinden;instanznamen vergeben;
zb.
ActionScript:
  1. deinInstanzname_txt._alpha = 50;
schrift wird durch einbinden unschön, datei wird größer;
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary

Geändert von andretti (20-02-2005 um 22:52 Uhr)
andretti ist offline   Mit Zitat antworten
Alt 20-02-2005, 23:45   #3 (permalink)
Der Wunderhund
 
Benutzerbild von gaspode
 
Registriert seit: Jun 2002
Ort: Hattingen
Beiträge: 10.515
>schrift wird durch einbinden unschön

in wie fern? ist mir noch nicht aufgefallen.
oder meinst du anti-aliasing?

gruß, gaspode
gaspode ist offline   Mit Zitat antworten
Alt 21-02-2005, 05:47   #4 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
nun, wenn ich dynamische schrift einbette, wird sie "dezent" verwischt dargestellt;
wenn ich die schrift nicht einbette, werden die lettern scharf dargestellt....

oder net?
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary
andretti ist offline   Mit Zitat antworten
Alt 21-02-2005, 07:38   #5 (permalink)
Neuer User
 
Registriert seit: Sep 2004
Beiträge: 888
neh das habe ich schon ausprobiert das amcht der aber nicht weil das in einer schleife liegt und wo das maxi. aus einem array kommt. ich habe das ganze schon mit einer fläche. aber wenn ich den text da drunter lege also in den MC dann wird läuft die sache nur halb.
flozwo ist offline   Mit Zitat antworten
Alt 21-02-2005, 07:47   #6 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
script posten
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary
andretti ist offline   Mit Zitat antworten
Alt 21-02-2005, 18:14   #7 (permalink)
Neuer User
 
Registriert seit: Sep 2004
Beiträge: 888
hi okay hier also ich wollte das wenn ich rollOver bin das man es sieht also _alpha =100;
und wenn rollOut _alpha =0;
das ist was ich bis jetzt gescriptet habe
ActionScript:
  1. var menu:Array = ["Menü", "Home", "Galerie", "News", "Bilder"];
  2. //trace(menu.sort());sortieren
  3. //box für navi
  4. _global.color_line = 0x02CCFF;
  5. _global.color_fill = 0x000033;
  6. //größe der box
  7. h = 20;
  8. br = 80;
  9. x = 200;
  10. y = 50;
  11. //css für text
  12. _global.style = new TextFormat();
  13. _global.style.bold = true;
  14. _global.style.color = 0xFFFFFF;
  15. _global.style.size = h-5;
  16. _global.style.font = "Arial";
  17. //ende
  18. for (i=0; i<=menu.length-1; i++) {
  19.     _root.start_btm.onRollOut = function() {
  20.         pull(0);
  21.         //z=menu.length;   
  22.         trace(menu.length);
  23.     };
  24.     _root.start_btm.onRollOver = function() {
  25.         pull(100);
  26.         //z=1;
  27.     };
  28. }
  29. function pull(alpha_menu) {
  30.     for (i=0; i<=menu.length-1; i++) {
  31.         //Farbflechen
  32.         /*
  33.         _root.createEmptyMovieClip("nav"+i, i);
  34.         _root["nav"+i].lineStyle(0.2, color_line, alpha_menu);
  35.         _root["nav"+i].beginFill(color_fill, alpha_menu);
  36.         _root["nav"+i].moveTo(x, y+(h*i));
  37.         _root["nav"+i].lineTo(x, y-h+(h*i));
  38.         _root["nav"+i].lineTo(x+br, y-h+(h*i));
  39.         _root["nav"+i].lineTo(x+br, y+(h*i));
  40.         _root["nav"+i].endFill();
  41.         */
  42.         //textpfelder für navi
  43.         //_root.createTextField("txt"+i, "30"+i, x+2, y-h+(h*i), x+br, h);
  44.         _root.createTextField("txt"+i, "30"+i, x+2, y-h+(h*i), br, h);
  45.         //htmlist erlaubt
  46.         _root["txt"+i].html = true;
  47.         _root["txt"+i].htmlText = '<a href="asfunction:link,'+menu[i]+'">'+menu[i]+'</a>';
  48.         //text box Einstellungen
  49.         _root["txt"+i].setTextFormat(style);
  50.         _root["txt"+i].selectable = false;
  51.         _root["txt"+i].wordWrap = false;
  52.         _root["txt"+i].multiline = false;
  53.         _root["txt"+i].autoSize = false;
  54.         _root["txt"+i].border = true;
  55.         _root["txt"+i].borderColor=0xccddcc;
  56.         _root["txt"+i].background=true;
  57.         _root["txt"+i].backgroundColor=0x000022;
  58.     }
  59. }
  60. function link(anker) {
  61.     trace("Der Parameter war "+anker);
  62. }
flozwo ist offline   Mit Zitat antworten
Alt 21-02-2005, 18:45   #8 (permalink)
Neuer User
 
Registriert seit: Sep 2004
Beiträge: 888
ich habe das ganze jetzt mal mit Interval versucht habe nciht so die große ahnung von interval
also das ganze sieht so aus wenn dies nicht überhabt gehen sollte einfach sagen und was cool wäre einen ansatz geben.
ActionScript:
  1. var menu:Array = ["Menü", "Home", "Galerie", "News", "Bilder"];
  2. //trace(menu.sort());sortieren
  3. //box für navi
  4. _global.color_line = 0x02CCFF;
  5. _global.color_fill = 0x000033;
  6. //größe der box
  7. h = 20;
  8. br = 80;
  9. x = 200;
  10. y = 50;
  11. //css für text
  12. _global.style = new TextFormat();
  13. _global.style.bold = true;
  14. _global.style.color = 0xFFFFFF;
  15. _global.style.size = h-5;
  16. _global.style.font = "Arial";
  17. //ende
  18. for (i=0; i<=menu.length-1; i++) {
  19.  
  20.     _root.start_btm.onRollOver = function() {
  21.         werte=setInterval(pull,0);
  22.         //pull();
  23.     };
  24.     _root.start_btm.onRollOut = function() {
  25.         clearInterval(werte);
  26.         //setInterval(pull,100);
  27.         //pull();
  28.     };
  29. }
  30. function pull() {
  31.     for (i=0; i<=menu.length-1; i++) {
  32.         //Farbflechen
  33.         /*
  34.         _root.createEmptyMovieClip("nav"+i, "30"+i);
  35.         _root["nav"+i].lineStyle(0, color_line,0);
  36.         _root["nav"+i].beginFill(color_fill, 30);
  37.         _root["nav"+i].moveTo(x, y+(h*i));
  38.         _root["nav"+i].lineTo(x, y-h+(h*i));
  39.         _root["nav"+i].lineTo(x+br, y-h+(h*i));
  40.         _root["nav"+i].lineTo(x+br, y+(h*i));
  41.         _root["nav"+i].endFill();
  42.         */
  43.         //textpfelder für navi
  44.         //_root.createTextField("txt"+i, "30"+i, x+2, y-h+(h*i), x+br, h);
  45.         _root.createTextField("txt"+i, i, x+2, y-h+(h*i), br, h);
  46.         //htmlist erlaubt
  47.         _root["txt"+i].html = true;
  48.         _root["txt"+i].htmlText = '<a href="asfunction:link,'+menu[i]+'">'+menu[i]+'</a>';
  49.         //text box Einstellungen
  50.         _root["txt"+i].setTextFormat(style);
  51.         _root["txt"+i].selectable = false;
  52.         _root["txt"+i].wordWrap = false;
  53.         _root["txt"+i].multiline = false;
  54.         _root["txt"+i].autoSize = false;
  55.         /**/
  56.         _root["txt"+i].border = true;
  57.         _root["txt"+i].borderColor=0x02ccff;
  58.         _root["txt"+i].background=true;
  59.         _root["txt"+i].backgroundColor=0x000033;
  60.        
  61.         //btns
  62.         _root["txt"+i].onRollOver = function(){
  63.        
  64.         }
  65.     }
  66. }
  67. function link(anker) {
  68.     trace("Der Parameter war "+anker);
  69. }
flozwo ist offline   Mit Zitat antworten
Alt 21-02-2005, 19:02   #9 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
aus der flashHilfe:

TextField.embedFonts
Verfügbarkeit
Flash Player 6.

Verwendung
mein_txt.embedFonts

Beschreibung
Eigenschaft; ein Boolescher Wert, der angibt, ob das Textfeld mit eingebetteten Schriftartkonturen (Font Outlines) wiedergegeben werden soll (true). Bei false wird das Textfeld anhand von Geräteschriftarten (Device Fonts) wiedergegeben.


--->
ActionScript:
  1. _root["txt"+i].embedFonts= true ;

bei der stelle"createTextfield hast du als tiefe die "30" unter anführungszeichen......is es nicht so, dass ,sobald zahlen unter anführungszeichen stehen, diese als string gelten?
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary

Geändert von andretti (21-02-2005 um 19:11 Uhr)
andretti ist offline   Mit Zitat antworten
Alt 21-02-2005, 19:10   #10 (permalink)
Neuer User
 
Registriert seit: Sep 2004
Beiträge: 888
ja ich habe da aber in einer schleife das heist "i" ist immer eine neue zahl und damit nicht
i=1
30 +i=31
sonder "30"+i=301
geschiet musste ich es in anführungsstrichen setzen.
flozwo ist offline   Mit Zitat antworten
Alt 21-02-2005, 19:17   #11 (permalink)
Neuer User
 
Registriert seit: Sep 2004
Beiträge: 888
das ist cool okay und wie mache ich das die btns stehen bleiben wenn ich drauf bin?
ich habe es mir so gedacht
ActionScript:
  1. for (i=0; i<=menu.length-1; i++) {
  2.         _root["nav"+i].onRollOver = function(){
  3.         pull(false,100);
  4.         }

uns so sieht das ganze jetzt aus
ActionScript:
  1. var menu:Array = ["Menü", "Home", "Galerie", "News", "Bilder"];
  2. //trace(menu.sort());sortieren
  3. //box für navi
  4. _global.color_line = 0x02CCFF;
  5. _global.color_fill = 0x000033;
  6. //größe der box
  7. h = 20;
  8. br = 80;
  9. x = 200;
  10. y = 50;
  11. //css für text
  12. _global.style = new TextFormat();
  13. _global.style.bold = true;
  14. _global.style.color = 0xFFFFFF;
  15. _global.style.size = h-5;
  16. _global.style.font = "Arial";
  17. //ende
  18.     _root.start_btm.onRollOver = function() {
  19.         pull(false,100);
  20.         //werte=setInterval(pull,0);
  21.         trace(werte);
  22.     };
  23.     _root.start_btm.onRollOut = function() {
  24.         pull(true,0);
  25.         //clearInterval(werte);
  26.         trace(werte);
  27.     };
  28.  
  29. function pull(werte,alpha) {
  30.     for (i=0; i<=menu.length-1; i++) {
  31.         //Farbflechen
  32.         _root.createEmptyMovieClip("nav"+i, i);
  33.         _root["nav"+i].lineStyle(0, color_line,alpha);
  34.         _root["nav"+i].beginFill(color_fill, alpha);
  35.         _root["nav"+i].moveTo(x, y+(h*i));
  36.         _root["nav"+i].lineTo(x, y-h+(h*i));
  37.         _root["nav"+i].lineTo(x+br, y-h+(h*i));
  38.         _root["nav"+i].lineTo(x+br, y+(h*i));
  39.         _root["nav"+i].endFill();
  40.         //textpfelder für navi
  41.         _root.createTextField("txt"+i, "30"+i, x+2, y-h+(h*i), br, h);
  42.         //htmlist erlaubt
  43.         _root["txt"+i].html = true;
  44.         _root["txt"+i].htmlText = '<a href="asfunction:link,'+menu[i]+'">'+menu[i]+'</a>';
  45.         //text box Einstellungen
  46.         _root["txt"+i].setTextFormat(style);
  47.         _root["txt"+i].selectable = false;
  48.         _root["txt"+i].wordWrap = false;
  49.         _root["txt"+i].multiline = false;
  50.         _root["txt"+i].autoSize = false;
  51.         /*
  52.         _root["txt"+i].border = true;
  53.         _root["txt"+i].borderColor=0x02ccff;
  54.         _root["txt"+i].background=true;
  55.         _root["txt"+i].backgroundColor=0x000033;
  56.         */
  57.         _root["txt"+i].embedFonts= werte ;
  58.         //btns
  59.     }
  60. }
  61.  
  62. function link(anker) {
  63.     trace("Der Parameter war "+anker);
  64. }
flozwo ist offline   Mit Zitat antworten
Alt 21-02-2005, 19:26   #12 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
sorry, verstehe nicht, was du meinst...
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary
andretti ist offline   Mit Zitat antworten
Alt 21-02-2005, 19:33   #13 (permalink)
Neuer User
 
Registriert seit: Sep 2004
Beiträge: 888
also wenn ich runter vom btn gehe dann ist das ja weg aber wenn ich auf die untern erzeugten btns gehe dann geht das auch weg da soll das aber noch da sein weil man sich da was aussuchen soll so wie ein java script pulldownmenü.
flozwo ist offline   Mit Zitat antworten
Alt 21-02-2005, 21:15   #14 (permalink)
Neuer User
 
Registriert seit: Sep 2004
Beiträge: 888
Question

also wäre es sinnvoll ein verzögerung reinzu setzten also wenn in 2sec. der werd alpha != 100 ist dann zuklappen.
das macht man doch mit setInterval oder?
flozwo 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 11:10 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele