you could put it into a sprite and apply alpha / transformations to that

code:

    import flash.text.TextField;
    import flash.text.TextFormat;
    import flash.display.Sprite;

            var myTextField:TextField = new TextField();
            myTextField.text = "Križev pot";
            myTextField.width = 800;
            myTextField.height = 200;
            myTextField.x = stage.stageWidth/2-200;
            myTextField.y = stage.stageHeight/2+50;
//          myTextField.alpha=0.5;     Comes out - replaced below

            myTextField.x++;//doean't work, how to do it?*
// this will set the textfield to (stage.stageWidth/2-200)+1 which i guess isn't what you want

            myTextField.border = false;
            var myFormat:TextFormat = new TextFormat();
            myFormat.color = 0xAA0000;
            myFormat.size = 92;
            myFormat.italic = false;
            myFormat.bold = true;
            myTextField.setTextFormat(myFormat);

            var mySprite:Sprite = new Sprite();
            mySprite.alpha = 0.5;

//          prolly best to put these after you've set everything els
            addChild(mySprite);
            mySprite.addChild(myTextField);

/code


On 18 Mar 2008, at 13:17, Pedro Kostelec wrote:

Hi

Is there a way to apply to som text added with as3 some motion or alpha?

I've got this working well:

    import flash.text.TextField;
    import flash.text.TextFormat;

var myTextField:TextField = new TextField();
            addChild(myTextField);
            myTextField.text = "Križev pot";
            myTextField.width = 800;
            myTextField.height = 200;
            myTextField.x = stage.stageWidth/2-200;
            myTextField.y = stage.stageHeight/2+50;
* myTextField.alpha=0.5;//doean't work, how to do it? Or should i
import something else???
       myTextField.x++;//doean't work, how to do it?*
            myTextField.border = false;
            var myFormat:TextFormat = new TextFormat();
            myFormat.color = 0xAA0000;
            myFormat.size = 92;
            myFormat.italic = false;
            myFormat.bold = true;
            myTextField.setTextFormat(myFormat);

--
Pedro D.K.
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to