Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 07-12-2006, 12:43   #1 (permalink)
Neuer User
 
Registriert seit: Nov 2006
Beiträge: 56
RadioButton Label mehrzeilig ???

Hi all,

gibt es eine Möglichkeit das Label eines Radiobuttons mit wordWrap auszustatten?

Leider sind die auszuwählenden Fragen z.T. 3 Zeilige Texte....

LG Dary

P.S: Könnte man notfalls die RadioButton Klasse umschreiben? Weiss jemand an welcher Stelle ich die editieren muss?
hab was in der UIObject.as gefunden
ActionScript:
  1. /**
  2. * @private
  3. * create a text label subobject.  Used by most components to get a lightweight
  4. * text object to display text in the component.
  5. *
  6. * @param    name    instance name of text object
  7. * @param    depth   z order of object
  8. * @param    text    text of object
  9. * @return   reference to text object
  10. */
  11.     function createLabel(name:String, depth:Number, text):TextField
  12.     {
  13.         //createTextField(name, depth, x, y, w, h);
  14.         createTextField(name, depth, 0, 0, 0, 0);
  15.         var o:TextField = this[name];
  16.         o._color = UIObject.textColorList;
  17.         o._visible = false;
  18.  
  19.         // defer the style lookup to the textfield's draw routine
  20.         o.__text = text;
  21.         // @@ this needs improvement, since margin will vary with the font and size
  22.     //  var margin = 4;
  23.     //  o.setSize(o.textWidth + margin, o.textHeight + margin);
  24.         if (tfList == undefined)
  25.             tfList = new Object();
  26.         tfList[name] = o;
  27.         o.invalidateStyle();
  28.         invalidate();      // force redraw call
  29.         o.styleName = this// labels always inherit styles of parent unless set otherwise
  30.         return o;
  31.     }

Allerdings wüsste ich jetzt nicht was ich ändern sollte.. eventuell ein o_wordWrap hinzufügen und die height mal auf 50 oder ähnlich stellen.
P.P.S: Könnte man auch durch den skin Befehl ein mehrzeiliges Label erzeugen?

Geändert von Dary (07-12-2006 um 13:11 Uhr)
Dary ist offline   Mit Zitat antworten
Alt 11-12-2006, 16:26   #2 (permalink)
Neuer User
 
Registriert seit: Nov 2006
Beiträge: 56
Ich hab mal mein prog angehängt.

Weiss jemand wie man dort den "Satz" mehrzeilig darstellen kann?

ActionScript:
  1. var temp:String="_"; //im echten code hat Temp einen dynamischen wert
  2.  
  3. var ml = {};
  4.  
  5. ml.click = function(obj)
  6.     {
  7.     trace(obj.target._name);
  8.     };
  9.  
  10. _root.createEmptyMovieClip("mc1", _root.getNextHighestDepth());
  11.  
  12. for (var j=0;j<10;j++){
  13. _root.mc1.attachMovie("RadioButton", "RB"+temp+j,_root.mc1.getNextHighestDepth(), {_x:205, _y:+20*j,  groupName:temp, _width:150});
  14. _root["mc1"]["RB"+temp+j]["labelPath"]["multiline"] = true;
  15. _root["mc1"]["RB"+temp+j]["labelPath"][autoSize] = "left";
  16. _root["mc1"]["RB"+temp+j]["labelPath"][wordWrap] =true;
  17. _root["mc1"]["RB"+temp+j]["label"]="aaaaaaaaaaaaaaa aaaaaaaaaaaaaa aaaaaaaaaaaaa aaaaaaaaaaaaaa aaaaaaaaaa aaaaaaaaaaarg";
  18. _root["mc1"]["RB"+temp+j].addEventListener("click", ml);
  19. }
  20. stop();
Angehängte Dateien
Dateityp: rar wordWrap.rar (46,1 KB, 3x aufgerufen)
Dary 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:13 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele