View Full Version : Help with onchange event

05-21-2012, 02:56 PM
HI, i know very little about javascript, just enough to get me into trouble actually lol.

Here is what im working with. I have a custom Instant messenger for members.

It uses embed object macromedia as well as javascript to diplay the window and send messages.

What i want to do is simply add an onchange that when one person is typing it shows they are typing (ie xxxxx is typing....)

My experience is in php and html and i looked thru the script and the javascript functions but im not sure what im looking for exactly. Do i need to have access to the swf or fla file and be able to edit them to do this? I dont see any form inputs or i would know exactly where to put the onchange lol. Im guessing the input is in the swf or fla file not sure how that works.

what im guessing is that in the embed or the object tags (ill play with it) i can put something like

document.write('test on change\n');

i think i need to wrap that in doc write script type=javascript in quotes so it parses.
If i can get that text to show up inside the IM where i want it then i can try to figure out how to set focus on box and recongize onchange and do some testing.
I think i might even be able to doc write the onchange command but not sure.


05-21-2012, 04:36 PM
When using "document.write" in an event handler like onchange you will erase the current document (and all of its content) and create a new (blank) one.

You should immediately learn about other DOM manipulating methods like .innerHTML, document.createElement, .appendChild() etc.

05-23-2012, 01:19 PM
Thanks for the tips, i did a search thru agent ransack and found the inputs in the fla files. But since i cannot edit the fla (i dont own flash) im screwed on this one i think.