2
votes

I need to insert code for flash to TinyMCE with JavaScript. If I insert the same code using HTML menu of TinyMCE, it automatically add flash icon to the editor. But if I insert the code using JavaScript, the actual code is inserted but it shows nothing on the screen.

One trick I found is toggle TinyMCE to normal textarea and back to TinyMCE. Then, it shows the flash icon. Is there a better way to do that?

Thanks.

Sam

2
The toggling trick has a big glitch. It flickers the editor. I found another way. At first, I used mceInsertContent which didn't repaint the editor. But mceInsertRawHTML works as I expect.Sam Kong
Sam, you totally made my day!!jodeci

2 Answers

2
votes

Try this code...

var content=tinyMCE.get('comment').getContent()+"ur flash content";
tinyMCE.get('comment').setContent(content);

Since i dont know about flash. but using this way u can insert into tinymce