Jump to content
Search Community

dynamic text field in TransformManager: text disappears on rotate

Dcoo test
Moderator Tag

Recommended Posts

is there sorting I could do to stop my dynamic text field from disappearing on rotate ?

 

yourtxt.addEventListener(MouseEvent.CLICK, textFrom);

 

function textFrom(event:MouseEvent):void

{

 

 

var textFormat:TextFormat = new TextFormat("Cubano","35","0xEFB20C","focusRectPadding",0);

 

var textField:TextField = new TextField();

textField.defaultTextFormat = textFormat;

textField.text = 'Your text here';

textField.x = 258.75;

textField.y = 100;

textField.width = 300;

textField.height = 80;

 

textField.multiline = true;

textField.wordWrap = true;

textField.type = "input";

 

textField.addEventListener(Event.RENDER, fixFocusRect);

function fixFocusRect(event:Event):void

{

event.target.drawFocus(false);

}

addChild(textField);

var manager:TransformManager = new TransformManager({targetObjects:[textField],hasSelectableText:true,forceSelectionToFront:true,allowDelete:true,autoDeselect:true,handleSize:22});

 

}

 

Link to comment
Share on other sites

Just changed textField.embedFonts = true; and now it works!

yourtxt.addEventListener(MouseEvent.CLICK, textFrom);
 
function textFrom(event:MouseEvent):void
{
 
 
var textFormat:TextFormat = new TextFormat();
textFormat.size = 35;
textFormat.font = "Cubano";
textFormat.color = 0xEFB20C;
 
 
/*"Cubano","35","0xEFB20C","focusRectPadding",0;*/
 
 
var textField:TextField = new TextField();
textField.defaultTextFormat = textFormat;
textField.text = 'Your text here';
textField.x = 258.75;
textField.y = 100;
textField.width = 300;
textField.height = 80;
textField.embedFonts = true;
textField.multiline = true;
textField.wordWrap = true;
 
textField.type = "input";
 
textField.addEventListener(Event.RENDER, fixFocusRect);
function fixFocusRect(event:Event):void
{
event.target.drawFocus(false);
}
addChild(textField);
var manager:TransformManager = new TransformManager({targetObjects:[textField],hasSelectableText:true,forceSelectionToFront:true,allowDelete:true,autoDeselect:true,handleSize:28});
 
}
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...