Hi,
Please mention which browser/platform you use.
It looks like this might be a Linux bug.
In IE5.5/Mozilla/NS4 on windows I get :
alert1 = HTML:null
alert2 = KEY:f
Layer = nullf
> Hello, I am wanting to type text directly into a dynlayer by using the
> keyup event. The only way that I knew how I could access the layer
> after a key was pressed was to make it a DynAPI variable.
Why? you can access the layer whatever kind of variable it is, like this is
fine:
textLayer = new DynLayer(null, 300,300, 300,300);
alert(textLayer.getHTML)
>But this acts
> kinda wierd, when the key is pressed for example 'A' it would put 'AA'
> on the dynlayer.
Didn't do that for me.
If you add a single space, as HTML of the layer, from the start, your code
seems to work as you want it too:
DynAPI.textLayer = new DynLayer(null, 300,300, 300,300,null,null,null,null,"
");
Cheers,
Richard
www.richardinfo.com
HTML: would be 'A' when it should be nothing and key
> is 'A', then it sets it 'AA'. But when I comment out the setHTML() line
> , HTML='', and KEY='A', and the layer doesn't set anything since it
> isn't called. It looks like DynAPI.textLayer.setHTML() is called twice.
> Is there a better way to access the textLayer variable when listening
> to a keyup?
> Note: I got the ideas of this from the link_and_form_events_NS4.html in
> the cvs tests.
>
> DynAPI.textLayer = new DynLayer(null, 300,300, 300,300);
> DynAPI.textLayer.setBgColor('yellow');
> DynAPI.document.addChild(DynAPI.textLayer);
>
> myListener = new EventListener(DynAPI.document)
> myListener.onkeyup=function(e) {
> alert("HTML:"+DynAPI.textLayer.getHTML());
> alert("KEY:"+e.charKey);
> DynAPI.textLayer.setHTML(DynAPI.textLayer.getHTML()+e.charKey);
> }
>
> Thanks,
> Matt
>
>
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/dynapi-help
>
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dynapi-help