Stroke and shadow effects of flash dynamic text

Source: Internet
Author: User

Let's not look at the dynamic text.

The code is as follows: Copy code

Level is used to display the level of a game:
Var level: Number = 0;
Var levelLabel: TextField = new TextField ();
Var levelText: TextField = new TextField ();
LevelLabel. text = "Level :";
LevelText. text = "1 ";
Level = 1;
LevelText. text = level. toString ();
In this way, the levelText content (level) is dynamic.

Stroke and shadow effect

The code is as follows: Copy code

// Using GlowFilter and DropShadowFilter in the filters filter package, we can easily achieve the text stroke and shadow effects in PS.
// The following is a demo code for the commonly used 12px ING and shadow effects:
// Text stroke effect
Var tf1 = _ root. createTextField ("tf1", _ root. getNextHighestDepth (), 10, 10, 0, 0 );
Tf1.autoSize = true;
Tf1.text = "AS trace text effect demonstration ";
Tf1.textColor = 0xFFFF00;
Var myGlowFilter = new flash. filters. GlowFilter (0x000000, 1, 2, 2, 10, 1, false, false );
Var myFilters: Array = tf1.filters;
MyFilters. push (myGlowFilter );
Tf1.filters = myFilters;
// Text shadow effect
Var tf2 = _ root. createTextField ("tf2", _ root. getNextHighestDepth (), 10, 30, 0, 0 );
Tf2.autoSize = true;
Tf2.text = "AS shadow text effect demonstration ";
Tf2.textColor = 0x000000;
Var myDropFilter = new flash. filters. DropShadowFilter (1, 45, 0 xFFFFFF, 1, 1, 1, 10, 1, false, false );
Var myFilters2: Array = tf2.filters;
MyFilters2.push (myDropFilter );
Tf2.filters = myFilters2;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.