Skip to main content
emmau10371638
Inspiring
March 21, 2018
Answered

textField.rotation don't work in Animate Air IOS

  • March 21, 2018
  • 2 replies
  • 976 views

Hello, I hope someone can help me.

textField.rotation don't work !

in Animate Air IOS .

Also on Ipad there isn't  Comic Sans lettertyp in TextField.

On other places there's no problem.

I have include Comic Sans MS in library, actionscriptname:ComicSansMS.

Below my code:

format1.font="ComicSansMS";

format1.size=30;

format1.bold=true;

_scoreField.border=false;

_scoreField.width = 50;

_scoreField.height = 50;

_scoreField.x=190;

_scoreField.y=343;

_scoreField.autoSize = TextFieldAutoSize.CENTER;

_scoreField.rotation=90;

_scoreField.defaultTextFormat=format1;

_scoreField.text = String(0);

addChild(_scoreField);

The number is invisible;

when i remove "_scoreField.rotation=90;" code, it is visible but not with rotation.

Thanks in advance!

This topic has been closed for replies.
Correct answer JoãoCésar17023019

Hi.

Adapting the example from this link: ActionScript - Rotating Text .

import flash.text.Font;

import flash.text.TextFormat;

import flash.text.TextField;

import flash.text.TextFieldAutoSize;

var format1:TextFormat;

var _scoreField:TextField;

var enumerableFonts:Array = Font.enumerateFonts(false);

format1 = new TextFormat();

format1.font = "ComicSansMS";

format1.size = 30;

format1.bold = true;

format1.font = enumerableFonts.length > 0 ? enumerableFonts[0]["fontName"] : "There are no embedded fonts.";

_scoreField = new TextField();

_scoreField.embedFonts = true;

_scoreField.defaultTextFormat = format1;

_scoreField.border = false;

_scoreField.width = 50;

_scoreField.height = 50;

_scoreField.x= 190;

_scoreField.y= 343;

_scoreField.autoSize = TextFieldAutoSize.CENTER;

_scoreField.rotation = 90;

_scoreField.text = String(0);

addChild(_scoreField);

I hope it helps.

Regards,

JC

2 replies

JoãoCésar17023019
Community Expert
JoãoCésar17023019Community ExpertCorrect answer
Community Expert
March 21, 2018

Hi.

Adapting the example from this link: ActionScript - Rotating Text .

import flash.text.Font;

import flash.text.TextFormat;

import flash.text.TextField;

import flash.text.TextFieldAutoSize;

var format1:TextFormat;

var _scoreField:TextField;

var enumerableFonts:Array = Font.enumerateFonts(false);

format1 = new TextFormat();

format1.font = "ComicSansMS";

format1.size = 30;

format1.bold = true;

format1.font = enumerableFonts.length > 0 ? enumerableFonts[0]["fontName"] : "There are no embedded fonts.";

_scoreField = new TextField();

_scoreField.embedFonts = true;

_scoreField.defaultTextFormat = format1;

_scoreField.border = false;

_scoreField.width = 50;

_scoreField.height = 50;

_scoreField.x= 190;

_scoreField.y= 343;

_scoreField.autoSize = TextFieldAutoSize.CENTER;

_scoreField.rotation = 90;

_scoreField.text = String(0);

addChild(_scoreField);

I hope it helps.

Regards,

JC

emmau10371638
Inspiring
March 22, 2018

Thank you  very much for the reply i will study it.

Ned Murphy
Legend
March 21, 2018

Normally, anytime you start rotating a dynamic textfield you need to embed the font in it.

emmau10371638
Inspiring
March 22, 2018

Thank you Ned for the reply. Yes i have embedded the font of course.

And give it an actionscript name;

It is a device font. maybe  was it important to say that about it.