After update old project throw a TextFormat errors !!!
Uncaught TypeError: Cannot set property 'align' of null
at com_black_views_ThirdSection.onAdded (HTMLsite.js:7472)
at openfl_events__$EventDispatcher_Listener.f [as callback] (HTMLsite.js:81212)
at com_black_views_ThirdSection.__dispatchEvent (HTMLsite.js:1292)
at com_black_views_ThirdSection.__dispatchEvent (HTMLsite.js:2204)
at com_black_views_ThirdSection.__dispatchWithCapture (HTMLsite.js:2244)
at openfl_display_Sprite.addChildAt (HTMLsite.js:3559)
at openfl_display_Sprite.addChild (HTMLsite.js:3511)
at com_black_views_BaseView.startSection (HTMLsite.js:6668)
at openfl_events__$EventDispatcher_Listener.f [as callback] (HTMLsite.js:81212)
at com_black_views_Core4.__dispatchEvent (HTMLsite.js:1292)
It is one example, others throw diffrent params such as leading*, font* and so on of textFormat Class. Simple code below
var f:TextFormat = this._tf1.getTextFormat();
f.leading = -10;
this._tf1.defaultTextFormat = f;
So getTextFormat() - return NULL.
but, var f:TextFormat = this._tf1.defaultTextFormat; - is working
New bug acquared. (dont know, maybe in old versions too)
class Main extends Sprite
{
private var _al1:Sprite = new Sprite();
private var _al2:Sprite = new Sprite();
public function new()
{
super();
this._al1.graphics.beginFill(0x32ABAB);
this._al1.graphics.drawRect(0, 0, 700, 350);
this._al1.graphics.endFill();
this._al2.graphics.beginFill(0xff0000);
this._al2.graphics.drawRect(0, 0, 700, 350);
this._al2.graphics.endFill();
_al1.alpha = _al2.alpha = 0;
stage.addEventListener(MouseEvent.CLICK, open);
addChild(_al1);
addChild(_al2);
}
public function open(e:MouseEvent = null):Void
{
trace("wtf");
_al1.y = 100;
_al2.y = 100;
_al1.alpha = 1;
_al2.alpha = 1;
Actuate.tween(_al1, 1, {alpha:0, y: 0}).ease(Linear.easeNone);
Actuate.tween(_al2, 1.1, {alpha:0, y: 200}).ease(Linear.easeNone);
}
Event appears every click, but after actuate tween once, in other click the objects don’t shown !!!
Wtf ? :))) And one more : bulid as html5 only, and build with -final statement - are diffrent shown!!!
Please test this code!
p.s and one more : if test with textField for example, bug never appears
Actuate automatically sets the visible property to false when animating alpha to 0. You can disable this behavior by using .autoVisible (false) on your tween.
You can fix your sample by using Actuate.apply (_al1, { alpha: 1 }); or by doing _al1.visible = true; _al1.alpha = 1;.
I would recommend apply, because that handles visible, but also will cancel any running animations (if there are any) so that they do not conflict with the state you want to use for your target objects
ohhhhhhhhhhhh ))) its really hard guess ))) For example in TweenMax - property alpha - works as alpha, but if we want autoVisible - we use autoAlpha property. Thanks for u answer
I just updated to the new openfl 8.2 and i has and issue with texfield.getTexformat()
well this is the thing, i cant get the size of a textfield if this is init with the value ‘’ or “” i leave a simple piece of code to check.
package;
import openfl.text.TextFormat;
import openfl.display.Sprite;
import openfl.text.TextField;
class Main extends Sprite {
public function new () {
super ();
var t:TextField=new TextField( );
var tf:TextFormat = new TextFormat( null ,21);
t.setTextFormat( t.defaultTextFormat = tf );
//t.text = 'a'; //any value here and i can get 21
trace(">>>>>>>> , should it be 21? in this case is null >>>> ", t.getTextFormat().size); //
trace("is this working in the correct way?");
}
}
This appears to be the way getTextFormat works on Flash. I just added a test to confirm
If you set t.defaultTextFormat, you can use t.defaultTextFormat.size to look it up. Otherwise it appears the value is null unless text is set to something more than ""
I want to know if I can compile a copy of the output used by the Window system from Mac. I don’t want to use neko because it doesn’t perform very well.