swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Swftools-common] How to create SWF's which can be navigated independent


From: david hendy
Subject: [Swftools-common] How to create SWF's which can be navigated independently
Date: Wed, 22 Jan 2014 08:31:13 +0000

Hi,

This issue relates to the viewing of SWF's converted from PDF documents which are then viewed on a web site which uses jQuery dialogs. 

I have found that when I view and navigate SWF's in 2 jQuery dialogs which are open simultaneously, navigation in one SWF file interferes with navigation in the other. To be specific as soon as I click on a viewer button in one document the document being shown in the other dialog immediately returns to the starting page.

Perhaps there is a way of preventing this from happening through selecting different options when I convert the PDF to the SWF and combine the SWF with a viewer.

The following shows how I created the navigable SWF's in my PHP script on my Windows 7 PC.

define('SWF_PATH', $root_folder_path.'swf/');
define("SWFCOMBINE_EXECUTABLE",SWF_PATH.'bin/swfcombine.exe');
define("SWFDUMP_EXECUTABLE",SWF_PATH.'bin/swfdump.exe');
define("PDF2SWF_EXECUTABLE",SWF_PATH.'bin/pdf2swf.exe');
define("SWF_VIEWER",SWF_PATH.'viewers/windows/technoargia.swf');

    // ----
    // Converts the PDF to a SWF file
    // ----
    $executable=PDF2SWF_EXECUTABLE;
    $command="$executable -o $temp_swf_file_not_browsable $temp_pdf_file";
    address@hidden($command,true);
    if(!empty($result))return $result;
    // ----
    // Adds navigation buttons to the SWF file
    // ----
    $executable=SWFCOMBINE_EXECUTABLE;
    $navigation_file=SWF_VIEWER;
    $command="$executable -o $temp_swf_file $navigation_file viewport=$temp_swf_file_not_browsable";
    address@hidden($command,true);
    if(!empty($result))return $result;
    // ----
    // Gets the coordinates of the viewport bounding box
    // ----
    $coordinates=returnWidthAndHeightOfSWF($temp_swf_file_not_browsable);
    // ----
    // Uses the coordinates of the bounding box to set the size of the SWF
    // ----
    $executable=SWFCOMBINE_EXECUTABLE;
    $command="$executable --dummy $coordinates $temp_swf_file -o $temp_swf_file";
    address@hidden($command,true);
    if(!empty($result))return $result;

function returnWidthAndHeightOfSWF($swf_file){
    $executable=SWFDUMP_EXECUTABLE;
    $command="$executable -XY $swf_file";
    $result=runCommand($command,true,true);
    $coordinates=$result[0];
    return $coordinates;
}

I can achieve segregation by showing the SWF in an iframe inside the jQuery dialog. However the problem with is that use of an iframe does not appear to lead to a satisfactory solution when accounting for when the user changes their browser window size. Specifically use of an iframe appears to rule out a client-side solution. A server-side solution is not ideal because window size has to be detected in a preceding page and applied in a subsequent page or page reload.

Any tips or pointers to achieving independently acting SWF's would be much appreciated.

Regards,

David.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]