Inconsistent textfield position exported from CS6


#1

Openfl : 7.0.0
Workflow : Npm

Hi all , I’m trying to exporting a MovieClip with a dynamic Textfield in It , the Textfield position is at x = 0, y = 0 ,
then I export it as .swf to be used by openfl targeting html 5 , the movieclip and textfield shown correctly on browser ,
but if I trace the textfield position it becomes x= -30.8 , y = 2 ,is this expected position value?

also if I add a DropShadowFilter to that textfield , the textfield is pushed far to the right with the same reported position x= -30.8 ,y= 2

anyone had counter this problem?


#2

Let me take a look, I don’t believe this is the way it works in the haxelib version. What are you using to trace it?

console.log (textField.x, textField.y);

…or something different?

Is there any chance you could share some of your project, even as a private message?


#3

Sorry for late reply ,

Workflow: Npm
Lang: Haxe

HaxeCompiler: 3.4.2 (installed locally)

( I removed the haxe dependencies from package.json since I want to use other haxe library in .hxml )

I’m using trace instead of console.log

thx


#4

Hmm, I have not been able to reproduce this. I’m using Animate CC (though I believe CS6 should work fine, too).

I have a TextField at (0, 0) on the stage in Animate, set to Dynamic and “_sans” as the font.

I’m loading it like this:

AssetLibrary.loadFromFile (require ("./assets/TextFieldTest.swf")).onComplete (function (library) {
	
	var clip = library.getMovieClip ("");
	addChild (clip);
	
	trace (clip.x, clip.y);
	
});

It’s appearing at (0, 0), and traces as 0 and 0

Perhaps you could share your SWF?


#5

This is the sample project
https://www.dropbox.com/s/i5t411446mclfsv/TextFieldIssue.zip?dl=0

thx


#6

Thank you for the sample!

Sometimes TextFields in Flash Professional or Animate have sort of a hidden offset X/Y, where it does not align the way an ActionScript TextField would. This is handled in our renderer, but recent changes to how we return our x and y property values caused this to be exposed. I have made changes to fix the return x and y values, as well as the render offset when using cacheAsBitmap (which is triggered by adding a filter):

We’ll have this in the next release :slight_smile:


#7

Thank you Singmajesty