Skip to content

Incorrectly styled text for labelKey (MouseEvent) | MOUSE_OUT -> gotoAndStop() causes text to vanish. #15110

@React1-X

Description

@React1-X

Describe the bug

buttonissues

buttonissues2

Since each of these issues seem closely related, I've included them all in this one issue.
From looking through the code, it seems as though the following are causing each:

  1. Text vanishes when MouseEvent.MOUSE_OUT is triggered, which uses a listener to call gotoAndStop()

  2. Stretched / incorrectly styled text seems to be either mouseEvent.target.labelKey or something to do with system fonts / formats: This code below is what is responsible for the styling of the texts within the buttons:

      public function Button()
      {
         super();
         this._startY = y;
         addEventListener(MouseEvent.MOUSE_OVER,this.Over);
         addEventListener(MouseEvent.MOUSE_OUT,this.Out);
         mouseChildren = false;
         buttonMode = true;
         this._format = new TextFormat();
         this._format.font = "Verdana";
         this._format.size = 9;
         this._format.align = TextFormatAlign.CENTER;
         this._format.color = 3355443;
         this._txt = new TextField();
         this._txt.selectable = false;
         this._txt.defaultTextFormat = this._format;
         this._txt.text = "xxxx";
         this._txt.width = 64;
         this._txt.height = 20;
         this.addChild(this._txt);
         this._txt.y = int(height / 2 - this._txt.height / 2 + 2);
         this._txt.x = 1;
         cacheAsBitmap = true;
      }

Expected behavior

For texts to stay visible when MOUSE_OUT is triggerd.
For text dimensions to display correctly.
For texts to be visible.

Content Location

The classes responsible for this behavior:

SWF: You can find our releases for the SWFs here

You can either connect to our servers and use the dev details below to bypass the auth, or, grab the localhost file and quickly setup a local server using these instructions.

Dev credentials:

Affected platform

Desktop app

Operating system

Windows 10

Browser

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-avm2Area: AVM2 (ActionScript 3)bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions