Re: Problem using CE as a seperate Flash/.swf selector

  •  12-03-2010, 8:09 AM

    Re: Problem using CE as a seperate Flash/.swf selector

    Sure Ken, here is the display page snippet:
     
    <asp:TextBox ID="ThumbnailTextBox" runat="server" Width="200px" MaxLength="255" />
    <input type="button" value="Flash" onclick="callInsertThumbnail()" id="ThumbnailButton" name="ImageButton" runat="server" /> <asp:RequiredFieldValidator runat="server" ID="FlashRequiredFieldValidator"  
              ControlToValidate="ThumbnailTextBox"  
              Display="Dynamic"  
              ErrorMessage="<p><b>Flash is required!</b></p>" />
    <div style="background-color: #FFFFFF>   
    <CE:Editor ID="ThumbnailEditor" runat="server" Width="1" Height="1" AutoConfigure="None"  
             ShowHtmlMode="False" ShowPreviewMode="False" EnableContextMenu="false" ShowGroupMenuImage="False"  
             ShowBottomBar="False" BackColor="White" BorderColor="White">                                       
    </CE:Editor>
    </div>
     
     and the CE/javascript handle snippet:
     
                        /* calls InsertFlash browser */
                        function callInsertThumbnail() {
                            var imageEditor = document.getElementById('CE_EditFormView_ThumbnailEditor_ID');
                            imageEditor.FocusDocument();
                            var editdoc = imageEditor.GetDocument();

                            imageEditor.ExecCommand('new');
                            imageEditor.ExecCommand('InsertFlash');

                            InputThumbnailURL();
                        }
                        /* populates Flash textbox with selected flash file */
                        function InputThumbnailURL() {                        
                            var flashEditor = document.getElementById('CE_EditFormView_ThumbnailEditor_ID');
                            var editdoc = flashEditor.GetDocument();
                            var imgs = editdoc.images;

                            if (imgs.length > 0) {                             
                                document.getElementById("EditFormView_ThumbnailTextBox").value = imgs[imgs.length - 1].src;                            
                                imageEditor.ExecCommand('new');
                                document.getElementById("EditFormView_ThumbnailTextBox").focus();
                            } else {
                                setTimeout(InputThumbnailURL, 500);
                            }
                        }
     
    The process is, when I click the ImageButton to select my flash(.swf) file, I'm presented with the CE InsertFlash dialog, I navigate and select my flash file then click the Insert button on the dialog and it returns to the form with nothing entered into the ThumbnailTextBox. No .NET or javascript errors.
     
    Like I mentioned above, in my InputThumbnailURL() function, I've tried the IF() condition setup for inserting images and inserting media and neither has returned my file path selection back to the input box. The images condition (imgs.length > 0) always returns 0 and the media file condition(flashEditor.getHTML()!="") always returns blank even though I have my file selected.
View Complete Thread