Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7987541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:10:45+00:00 2026-06-04T12:10:45+00:00

Actionscript Bitmap (or BitmapData) is weird. Not only it’s cacheAsBitmap is false by default,

  • 0

Actionscript Bitmap (or BitmapData) is weird. Not only it’s cacheAsBitmap is false by default, but it seems BitmapData is not really just a bitmap!

I found out, that animating Text Lines alpha will make them blink. I tried to workaround it in many ways, one of which was drawing text with backgrounds to bitmaps and animating the bitmaps:

package 
{
    import flash.events.Event;
    import flash.display.Sprite;

    import flash.display.Bitmap;
    import flash.display.BitmapData;

    import flash.text.TextField;

    public class Main extends Sprite 
    {
        private var bdata1:BitmapData = new BitmapData ( 150, 50, false, 0xDDDDFF );
        private var bitmap1:Bitmap = new Bitmap( bdata1 );
        private var bdata2:BitmapData = new BitmapData ( 100, 100, false, 0x00FFFF );
        private var bitmap2:Bitmap = new Bitmap ( bdata2 );

        private var show:Boolean = false;

        public function Main():void 
        {
            stage.frameRate = 1;
            var tf:TextField = new TextField ();
            tf.text = "layer top";
            bdata1.draw( tf );
            tf.text = "layer bottom"
            bdata2.draw ( tf );

            //*
            bitmap1.cacheAsBitmap = true;
            bitmap2.cacheAsBitmap = true;
            //*/

            addChild ( bitmap2 );
            addChild ( bitmap1 );
            addEventListener (Event.ENTER_FRAME, onEnterFrame );
        }   

        private function onEnterFrame ( e:Event ):void
        {
            if ( show ) var diff:Number = .2;
            else diff = -.2;

            bitmap1.alpha += diff;
            if ( bitmap1.alpha >= 1 ) {
                show = false;
                bitmap1.alpha = 1;
            }
            else if ( bitmap1.alpha <= 0 ) {
                show = true;
                bitmap1.alpha = 0;
            }
        }
    }
}

What it should do is smoothly (well, if You change the FPS) transition between “Layer bottom” and “Layer top” text. What it does is weird, at least on my machine, showing clearly that the text in bitmap is not treated like a bitmap, but still as a vector (TextLine probably). So is BitmapData only emulating bitmap? Is it a bug? Am I missing something?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T12:10:47+00:00Added an answer on June 4, 2026 at 12:10 pm

    First of all, you need to embed Font in swf. Lets assume you have embedded "Arial". Then try this:

    var tf:TextField = new TextField ();
    var tf_format:TextFormat = tf.defaultTextFormat;
    tf_format.font = "Arial";   //Specifying embedded font's name
    tf.defaultTextFormat = tf_format; 
    tf.embedFonts = true;
    tf.antiAliasType = AntiAliasType.ADVANCED;
    //.........
    

    After this, you will have ‘smooth text’.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When rotating a bitmap with actionscript, the edges are jagged and not properly anti-aliased.
ActionScript 3, just learning AS3 but know a handful of other languages. What would
How can I embed a bitmap in Actionscript 3 and get the BitmapData? public
How do you reference a bitmap on the stage in flash using actionscript 3?
In ActionScript, how can you test if an object is defined, that is, not
In ActionScript 3, when you declare an optional argument by giving it a default
I am using Actionscript 2.0 In a Brand new Scene. My only bit of
I need to dynamically color a grayscale gradient bitmap with ActionScript 3.0. Gradient goes
Is it possible to get the bitmap data from a component using ActionScript? I
Question: In Flash ActionScript 3, I extend a MovieClip as show below. But when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.