Problem using CE as a seperate Flash/.swf selector

  •  12-02-2010, 3:36 PM

    Problem using CE as a seperate Flash/.swf selector

    Having trouble with the InputURL() function. Despite trying two different methods for populating my textbox back after the .swf selection, my textbox is still not populating. I've narrowed it down to the IF condition check not working using the check Images or Media files, like on other posts I read. What else can I try?
     
    Tried the following two code snippets:
    1. function InputURL()   
    2.     {    
    3.         var editor1 = document.getElementById('CE_Editor1_ID');   
    4.         var editdoc = editor1.GetDocument();     
    5.         var imgs = editdoc.images;   
    6.         if(editor1.getHTML()!="")     
    7.         {      
    8.             var s = editor1.getHTML();   
    9.             s=s.replace(/(<object[^\>]*>[\s|\S]*?)(<embed[^\>]*?)(\ssrc=\s*)\s*("|')(.+?)\4([^>]*)(.*<\/embed>)[\s|\S]*?<\/object>/gi,"$5");   
    10.             document.getElementById("imageFld").value = s;   
    11.             editor1.ExecCommand('new');   
    12.             document.getElementById("imageFld").focus();    
    13.         }     
    14.         else  
    15.         {   
    16.             setTimeout(InputURL,500);    
    17.         }     
    18.     }
    and also this one:
     
    1. function InputURL()   
    2.     {    
    3.         var editor1 = document.getElementById('CE_Editor1_ID');   
    4.         var editdoc = editor1.GetDocument();     
    5.         var imgs = editdoc.images;   
    6.         if(imgs.length > 0)     
    7.         {      
    8.             var s = editor1.getHTML();   
    9.             s=s.replace(/(<object[^\>]*>[\s|\S]*?)(<embed[^\>]*?)(\ssrc=\s*)\s*("|')(.+?)\4([^>]*)(.*<\/embed>)[\s|\S]*?<\/object>/gi,"$5");   
    10.             document.getElementById("imageFld").value = s;   
    11.             editor1.ExecCommand('new');   
    12.             document.getElementById("imageFld").focus();    
    13.         }     
    14.         else  
    15.         {   
    16.             setTimeout(InputURL,500);    
    17.         }     
    18.     }
    and neither have worked.
     
    Thanks for you help!
     
     
View Complete Thread