Purtroppo sono ancora qui con un altro problema: funziona solo con selectable!!! Gli altri non funzionano, e il testo si nasconde! (Sono un po pirla, ma non così tanto da mettere tutti come boolean!)
Ecco il codice intero:
Codice PHP:
var Testo:TextField = new TextField();
var TestoTextFormat:TextFormat = new TextFormat();
var Xml:XML =
<Xml>
<Testo>
<Alpha>1</Alpha>
<AutoSize>left</AutoSize>
<Background>true</Background>
<BackgroundColor>0x000000</BackgroundColor>
<Border>true</Border>
<BorderColor>0x000000</BorderColor>
<Height>20</Height>
<Multiline>false</Multiline>
<Rotation>0</Rotation>
<Selectable>false</Selectable>
<Visible>true</Visible>
<Width>240</Width>
<x>50</x>
<y>25</y>
<Align>left</Align>
<BlockIndent>0</BlockIndent>
<Bold>true</Bold>
<Bullet>false</Bullet>
<Color>0xFFFFFF</Color>
<Font>Courier New</Font>
<Indent>0</Indent>
<Italic>false</Italic>
<Leading>0</Leading>
<LeftMargin>0</LeftMargin>
<LetterSpacing>0</LetterSpacing>
<RightMargin>0</RightMargin>
<Size>14</Size>
<Underline>false</Underline>
</Testo>
</Xml>
;
Testo.alpha = Xml.Testo.Alpha as Number;
Testo.autoSize = Xml.Testo.AutoSize as String;
Testo.background = Xml.Testo.Background as Boolean;
Testo.backgroundColor = Xml.Testo.BackgroundColor as uint;
Testo.border = Xml.Testo.Border as Boolean;
Testo.borderColor = Xml.Testo.BorderColor as uint;
Testo.height = Xml.Testo.Height as Number;
Testo.multiline = Xml.Testo.Multiline as Boolean;
Testo.rotation = Xml.Testo.Rotation as Number;
Testo.selectable = Xml.Testo.Selectable as Boolean;
Testo.visible = Xml.Testo.Visible as Boolean;
Testo.width = Xml.Testo.Width as Number;
Testo.x = Xml.Testo.x as Number;
Testo.y = Xml.Testo.y as Number;
TestoTextFormat.align = Xml.Testo.Align;
TestoTextFormat.blockIndent = Xml.Testo.BlockIndent as Object;
TestoTextFormat.bold = Xml.Testo.Bold;
TestoTextFormat.bullet = Xml.Testo.Bullet;
TestoTextFormat.color = Xml.Testo.Color;
TestoTextFormat.font = Xml.Testo.Font;
TestoTextFormat.indent = Xml.Testo.Indent;
TestoTextFormat.italic = Xml.Testo.Italic;
TestoTextFormat.leading = Xml.Testo.Leading;
TestoTextFormat.leftMargin = Xml.Testo.LeftMargin;
TestoTextFormat.letterSpacing = Xml.Testo.LetterSpacing;
TestoTextFormat.rightMargin = Xml.Testo.RightMargin;
TestoTextFormat.size = Xml.Testo.Size;
TestoTextFormat.underline = Xml.Testo.Underline;
Testo.defaultTextFormat = TestoTextFormat;
Testo.text = 'ciao';
addChild(Testo);
E poi esce un output che recita:
Il valore del parametro autoSize deve essere diverso da null.
Però non è null, ed è una stringa come dice la guida ad as3 della adobe...
Grazie ancora e (mi ero dimenticato) AUGURI!!