How can i access __div

Dear all,

I’d appreciate help on accessing _div from DisplayObjects (when rendered via DOM).

I’ve asked this recently here but no help so far https://groups.google.com/forum/#!topic/haxelang/b_CwRUIv9AY

The below gives me Null :S

Thanks
Andy.

@:access(openfl._internal.renderer.dom.DomTextField, openfl.text.TextField)
	public function new() 
	{
		super();
		
		var tf = new TextField();

	
		
		tf.addEventListener(Event.ADDED_TO_STAGE, function(e:Event) { 
		trace(tf.__div);	
			
		} );
                this.addChild(tf);
}

Is this so you can implement the multiline and other text input features? Depending on where you are trying to port your program, it might honestly be best to have a different set of code specifically for DOM (eg. using #if dom) so you can have full control over the features you need. As we’ve seen here, text input implementation for DOM seems incomplete. You could alternatively try implementing the quickfix by jeff_ward (on that same page); when properly tested we can even make a pull request for this set of features.

I’m out of town for the week and am away from all my normal stuff, so I’m only able to offer advice and can’t test code ) :

Hi,

yes, that’s right. But there are other features too that direct acces to DOM allows for (e.g. maxChars, and restrictChars).

I’ve hacked in Jeff’s solution for the time being.

Keen on helping any way I can. :slight_smile:

cheers,
Andy.