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.

xLite
  • 1,441
  • 3
  • 15
  • 28
  • have you tried a system font, like Arial? – Marijn Jul 16 '13 at 21:21
  • Just tried, yep it still shows the flashing white pixel. – xLite Jul 16 '13 at 21:25
  • 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? – catholicon Jul 16 '13 at 23:05
  • 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. http://i.imgur.com/76CBd4R.png – xLite Jul 17 '13 at 01:40
  • 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. – xLite Jul 17 '13 at 01:42
  • What happens if you switch embedFonts to false? I cannot reproduce it. – ZuzEL Jul 19 '13 at 20:19
  • 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. – xLite Jul 19 '13 at 21:12
  • Can you supply a FLA that produces this issue? – Marty Aug 02 '13 at 07:38
  • 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.". – xLite Aug 02 '13 at 11:00
  • This applies as long as you're running the SWF in one of the flash players I mentioned in my original post. – xLite Aug 02 '13 at 11:01
  • Also I said I'm using FlashDevelop, so there is no FLA file involved. – xLite Aug 02 '13 at 17:02
  • 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? – starmole Aug 03 '13 at 04:51
  • @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. – Plastic Sturgeon Aug 03 '13 at 17:41

4 Answers4

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.

quarion
  • 114
  • 6
0

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

double-beep
  • 5,031
  • 17
  • 33
  • 41
Gaurav
  • 1,214
  • 2
  • 17
  • 32
  • 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. – xLite Aug 02 '13 at 17:09
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);
        }

    }
}
Plastic Sturgeon
  • 12,527
  • 4
  • 33
  • 47
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.

shovemedia
  • 191
  • 4