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.  But this acts 
kinda wierd, when the key is pressed for example 'A' it would put 'AA' 
on the dynlayer.  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

Reply via email to