Random flashing white pixel at the bottom of the insertion point/caret in TextField? (Flash/AS3)
Asked Answered
B

4

8

I am using FlashDevelop & Flash Player 11.7 (NPAPI version).

Basically I see a random white pixel at the bottom of the insertion point/caret/text cursor that appears when a TextField has focus. It constantly flashes as the text cursor flashes but at different intervals. It's driving me crazy.

Here's a screen grab I managed to get after a few attempts:

Screen Grab

Why does it do this and what do I do to disable it?

this._textField = new TextField();
this._textField.defaultTextFormat = new TextFormat("FleftexYC", 8, 0x000000, true);
this._textField.embedFonts = true;
this._textField.height = 13;
this._textField.type = TextFieldType.INPUT;
this._textField.x = 9;
this._textField.y = 7;

FleftexYC is a custom/embedded font, but that's not the issue. This still happens with system fonts like Arial.

Any thoughts?

[EDIT]: Confirmed in 11.8 also. However, In Internet Explorer the pixel is black and not white.

[EDIT]: I am using Windows 7, not sure if this happens on Macs too. This not happen on Google Chrome's PPAPI version of Flash but it does happen in the NPAPI version and Internet Explorer's version.

[EDIT]: In addition to Internet Explorer, it looks like Mozilla Firefox also shows a flashing black pixel instead of a white one.

Birdwatcher answered 16/7, 2013 at 21:15 Comment(13)
have you tried a system font, like Arial?Howund
Just tried, yep it still shows the flashing white pixel.Birdwatcher
The "I" shaped mouse pointer over text fields have a small gap in the middle of top and bottom horizontal lines. Could this artifact be a combination of flashing text cursor and the gap of mouse pointer? Can you try changing the background of movie and see where exactly is that pixel coming from?Goatish
The pixel follows the text cursor within the text field, it has nothing to do with the mouse cursor. Although, I tried seeing what happens when the text-overflow and the text moves. It seems that the more you type within a fixed-width both, the further right the white flashing pixel seems to move. i.imgur.com/76CBd4R.pngBirdwatcher
It happens every time, try making a custom project in front of a stage with a darker background. Add a textfield with white text, any system font and it should show the white flashing pixel when in focus.Birdwatcher
What happens if you switch embedFonts to false? I cannot reproduce it.Pine
I've tried system fonts like Arial and others, so setting embedFonts to false doesn't really change anything. I am using Windows 7 if that helps.Birdwatcher
Can you supply a FLA that produces this issue?Twitt
Check my previous comment, "It happens every time, try making a custom project in front of a stage with a darker background. Add a textfield with white text, any system font and it should show the white flashing pixel when in focus.".Birdwatcher
This applies as long as you're running the SWF in one of the flash players I mentioned in my original post.Birdwatcher
Also I said I'm using FlashDevelop, so there is no FLA file involved.Birdwatcher
Wow crazy. I know that embedded and system fonts go through vastly different code paths. So if it happens in both there must be another reason. Do you have anything non standard running? Custom window manager? Accessibility tools? Can you repo on a clean install in a VM?Delciedelcina
@Xlite - I posted a complete class for a FlashDevelop project below, it uses a dark background, and the problem does not occur. Would you please try that one and tell me your result? I am also using FlashDevelop but that project does not cause the problem for me. Doing this could help us narrow it down.Bookstack
S
0

I can't reproduce your error, but maybe setting .cacheAsBitmap on the text field will help. It will slow it down a little - but you must try it yourself.

Salish answered 26/7, 2013 at 11:15 Comment(1)
What are your specs? I tried setting cacheAsBitmap, it did nothing.Birdwatcher
W
0

If you haven't published your HTML file from flash, try to copy the whole publish code in your page.

Weatherboarding answered 2/8, 2013 at 13:25 Comment(1)
As I mentioned, this is 11.7 NPAPI onwards (including 11.8 and the other versions included in the original post). This is not using a HTML file, just the normal SWF file running in the standalone plugin. There's no trick to it, just use a TextField with white text over a dark background.Birdwatcher
B
0

I built a test class that isolates the problem as described, and the problem does not reproduce. You should be able to create a new project in flash develop and test it in any browser and see that the problem is not caused by any of the code you show above.

It may be caused by some other part of your program, such as when you assign the value to "test" and set the selection. But you can eliminate some possible causes by running this.

If the problem does exist on your machine running this code, then somehow your version of flash is corrupted. Remove and reinstall should fix it, or there is some other unique aspect of that machine that is causing your flash to compile in a non-standard way. (but for what its worth, this is pretty unlikely)

Another possibility is the browser. Are your sure your browser zoom is set to 0? This also seems unlikely. Are you using other API's like stage3D? A custom anti-alias?

Here is my class:

    package 
{
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.text.TextField;
    import flash.text.TextFieldType;
    import flash.text.TextFormat;

    /**
     * ...
     * @author Zachary Foley
     */
    public class Main extends Sprite 
    {
        //[Embed(source='C:/WINDOWS/Fonts/verdana.ttf', fontFamily="Verdana", fontWeight="regular", embedAsCFF="false")]
        [Embed(source='C:/WINDOWS/Fonts/arial.ttf', fontFamily="Verdana", fontWeight="regular", embedAsCFF="false")]
        public var Verdana:Class;

        private var mytextfield:TextField = new TextField();
        private var mytextformat:TextFormat = new TextFormat();
        private var _textField:TextField;

        public function Main():void 
        {
            if (stage) init();
            else addEventListener(Event.ADDED_TO_STAGE, init);
        }

        private function init(e:Event = null):void 
        {
            removeEventListener(Event.ADDED_TO_STAGE, init);
            // entry point
            this._textField = new TextField();
            this._textField.defaultTextFormat = new TextFormat("Verdana", 8, 0x000000, true);
            this._textField.embedFonts = true;
            this._textField.height = 13;
            this._textField.type = TextFieldType.INPUT;
            this._textField.x = 9;
            this._textField.y = 7;
            this._textField.text = "Test";
            addChild(_textField);
        }

    }
}
Bookstack answered 3/8, 2013 at 0:20 Comment(4)
Did you use the player versions I mentioned in my original post? Also are you on Windows yeah?Birdwatcher
yes. I'm using Flash Player version 11.8 - what version of flex SDK and publish to settings are you using. And windows 7 64 bit. Tested in latest build of chrome, firefox and IE.Bookstack
Seems like it's the 64bit version that's hiding it. Any chance you can try on 32 bit?Birdwatcher
With all these computers, no 32 bit windows. Anybody else?Bookstack
R
0

TextFields in Flash are notorious for weird rendering problems as your app gets more complicated. They'll be fine, and then suddenly, a seemingly unrelated change blows everything up. There's a steep learning curve, but switch to TLF fields. Way more stable.

Rancidity answered 3/11, 2013 at 2:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.