CapeSoft.Com
Clarion Accessories
FileExplorer
Documentation
feFlash
CapeSoft Logo

CapeSoft File Explorer feFlash
Documentation

Download Latest Version
Installed Version Latest Version

File Explorer Classes - FeFlash

Formerly known as the Flash file type / object, the FeFlash Object is used to display Macromedia Flash files.
Class Methods
NameDescription
CurrentFrameReturns the number of the frame that is the flash movie is on.
EventCallbackUsed to trap events that the flash viewer generates and allow you to respond to them in your application.
GetInfoRetrieves various information from the Flash control. This is used to get the player settings and information.
GetSWFHeaderRetrieves the file header information (includes information about the movie such as the size, framerate etc.)
GetVariableGets the value of the variable in the Flash movie. These are variables used in any scripts that the file contains.
InitInitialises the class, should be called before any other methods are (with the exception of GetSWFHeader).
KillCleans up and disposes allocated memory. If Init() is called then Kill() must be called before the procedure exits.
LoadLoads a file into the Flash control
NavigateMoves forward or backward in the movie. Can move to the start or end as well as moving forward and backwardsby the specified number of frame.
PausePauses the playback of the currently loaded file
PlayPlays the currently loaded file
ReloadReloads the current file, resets the playback etc.
SetVariableSets the value of a variable used in a Flash movie. Variables are declared in the Flash file and used in any scripts in the file.
StopStops playback
UpdateUpdates the player settings and information, GetInfo retrieves this information and Update sets it.

Class Method Reference

CurrentFrame

CurrentFrame () ,long

Description

Call this method to establish the currently loaded frame of the flash file which is playing. The method returns the number of the frame that flash movie is currently at.

TIP: See the FeFlash_MainExampleprocedure in the feabc.app example application to see this method being used. Parameters

None

Return Value

The return value is a long indicating which frame the movie is on, with the movie starting at frame 1 and playing until the last frame.

Example
Example
  code
    ! Check if the movie has finished playing, if so offer to start again.
    
if FlashPlayer.CurrentFrame() = FlashPlayer.GetInfo(FlashTotalFrames)
        
if Message('Playback Complete, would you like to play the movie again?',
                   '
Play Again?', Icon:Question, Button:Yes + Button:No) = Button:Yes
            FlashPlayer.Navigate(1)
            FlashPlayer.Play()
        
else
            FlashPlayer.Stop()      
! Stop the movie, in case it is going to loop
        
end
    
end

EventCallback

EventCallback ( long EventID, string Parm1, string Parm2 ),long

Description
Example
ToDo

GetInfo

GetInfo ( )

Description
Example
Example
ThisViewer1.GetInfo ( )

GetSWFHeader

GetSWFHeader (*fwSWHeader pHeader)

Description

Used to retrieve the header information from a SWF File. This method reads a SWF file from disk and extracts the header information from it. Becuase this method interacts with an actual file on disk it is the only method in the class that can be called without calling the Init method or even having a control on the window. You can declare a class and use this method as a "standalone" way to read the header information from an SWF file on disk.

Parameters
Parameter Description
*fwSWHeader pHeader: A feSWFHeader group that contains the path of the SWF File to read. All other fields in the feSWFHeader group are filled by the function with the values retrieved from the SWF file.
Return Values

Returns 1 for sucess and zero if the function failed. If the method fails it calls the DbgMsg function to print an error message in debug mode. The debug information can displayed using a utility such as DebugView from www.sysinternals.com. See the Debug and Logging section in the main documnetatio for more information. Example
Example
fHeader           group(feSWFHeader)
                  end
ThisFlash class(feFlash)
  code
    fHeader.FilePath = LongPath() & '\Movie.swf'
    if not ThisFlash.GetSWFheader(fHeader)
        Message('Could not retrieve the header information for the selected SWF file')
    end

GetVariable

GetVariable ( string pName ),string,proc

Description
Example
Example
TempString = ThisViewer1.GetVariable ('Variable1')

Init

Init ( long ParentControl, <string LoadPath>, long Handle1=0, long Handle2=0, byte SkipCallbacks=false ),byte,proc

Description
Example
Example
ThisViewer1.Init (?feControl)

Kill

Kill ()

Description
Example
Example
ThisViewer1.Kill()

Load

Load ( string CurrentPath, <long CurrentControl> )

Description
Example
Example
ThisViewer1.Load('c:\test.swf')

Navigate

Navigate ( byte Location, <short PageNumber>, <string Optionals>)

Description
Example
Example
ThisViewer.Navigate(1)

Pause

Pause ( )

Description
Example
Example
ThisViewer.Pause()

Play

Play ( )

Description
Example
Example
ThisViewer.Play()

Reload

Reload ( <long CurrentControl> )

Description
Example
Example
ThisViewer.Reload()

SetVariable

SetVariable ( string pName, string pValue ),byte,proc

Description
Example
Example
ThisViewer1.SetVariable ('Variable1','Hello world')

Stop

Stop ( )

Description
Example
Example
ThisViewer.Stop()

Update

Update ( string Property, string PropValue )

Description
Example
Example
ThisViewer.Update ('FlashQuality',1)

FeFlash - Properties (alphabetical)

FlashTotalFrames (Long)This property holds the number of frames which the currently loaded Flash file contains. Use the GetInfo method to update the value of this property.
FlashPlaying (Byte)Holds true (1) if a file is currently playing, or false (0) if not, or if a loaded file is paused. Use the GetInfo method to update the value of this property.
FlashLoop (Byte)Sets whether the loaded flash file will play once, or loop continuously. Use the GetInfo method to update the value of this property.
FlashMoviePath (String)Holds the path / url of the loaded flash file. Use the GetInfo method to update the value of this property.

Class Properties

This section lists useful properties of the class that can be set directly. In many cases the class properties are set by methods, which may also modify other associated properties etc. Properties that should not be modified without using the methods provided are not covered in this section.

Data Types and Equates

This section lists useful properties of the class that can be set directly. In many cases the class properties are set by methods, which may also modify other associated properties etc. Properties that should not be modified without using the methods provided are not covered in this section.

feSWFHeader group, type

The SFWHeader group is used in conjunction with GetSWFHeader method to get the header information from an SWF file. The GetSWFHeader supports both compressed and uncompressed SWF files, and loads the file from disk, so you don't actually need an feFlash control, and feFlash.Init() does not need to be called in order to use this method.

Fields

Fields
NameData type Description
FilePathstring(300)The path of the file to load and retrieve the header information for. If the file is in the current path this can be the name of the SWF file, otherwise the SWF filename and the full path should be used.
Signaturestring(3)A three character string that contains the SWF signature indicating that the file is a SWF file. If this is a standard Flash file the signature will be 'FWS', if it is a compressed Flash file it will be 'CWS'. Any other value indicates an invalid file.
VersionbyteThe Flash version of this file.
FileSizeulongThe size of the file.
DiskFileSizeulongThe actual size of the SWF on disk.
WidthlongThe width of the movie in pixels.
HeightlongThe height of the movie in pixels.
Ratedecimal(4,2)The frame rate that the movie plays back at.
CountushortThe total number of frames in the movie.
Example

fHeader       		group(feSWFHeader)
end ThisFlash class(feFlash) code fHeader.FilePath = LongPath() & '\Movie.swf' if not ThisFlash.GetSWFheader(fHeader) Message('Could not retrieve the header information for the selected SWF file') end

FeFlash - Templates

At this time there is quite an overlap in terms of multiple File Explorer classes being implemented by the same templates. In the future we may revisit this, but for now all templates are covered in the main (FileExplorer.htm) help document, please click here.

SWFHeader

Summary of callback events

See the FeFlash_Callbacks procedure in the feabc.app example application for more info.
Event Name: Equate: Description:
OnReadyStateChangefe:SWFEvt_OnReadyStateChange
OnProgressfe:SWFEvt_OnProgress
FSCommandfe:SWFEvt_FSCommand