TShockwaveFlash properties and methods
You can read the original documentation at adobe.com. That documentation adapted to pascal language syntax is below. Here are properties and methods of the native flash object only (without inherited ones from TWinContol)
|AlignMode||Integer value from range 0..15. This is the same as SAlign.
0 - no align, 1 - L, 2 - R, 3 - LR, 4 - T, 5 - LT, 6 - TR, 7 - LTR, 8 - B, 9 - LB, 10 - RB, 11 - LRB, 12 - TB, 13 - LTB, 14 - TRB, 15 - LTRB.
|AllowScriptAccess||Ability to perform outbound scripting from within a SWF. Outbound scripting is achieved through use of FSCommand actions or getURL actions that specify a scripting statement.
"never" - outbound scripting always fails;
"always" - outbound scripting always succeeds.
|BackgroundColor||Override the background color of a movie. An integer of the form
BackgroundColor := red shl 16 + green shl 8 + blue;
Use -1 for the default movie color.
|Base||Specifies the base directory or URL used to resolve all relative path statements in the Flash Player movie. This attribute is helpful when your Flash Player movies are kept in a different directory from your other files.|
|BGColor||String value is in format RRGGBB. Value is the same as BackgroundColor.|
|DeviceFont||If set to true and the font is installed on the system viewing the Flash movie, the font information installed on the system will be substituted. Text will be aliased (rough) despite the value of the quality attribute. If the font is not installed on the system, the text will come out anti-aliased (smooth) as long as the quality of the movie is set at high.|
|EmbedMovie||Embedes the *.swf file (is set at the Movie property) into the *.exe file. True value setting is possible for design mode only. If the property is set as true value, then another movie's loading is ignored in runtime mode.|
|FlashVars||Used to send root level variables to the movie. The format of the string is a set of name=value combinations separated by '&'. Browsers will support string sizes of up to 64KB (65535 bytes) in length.
Note: Requires Macromedia Flash Player 6 or later.
|FrameNum||The currently displayed frame of the movie. Setting this will advance or rewind the movie.|
|Loop||True if the animation loops, false to play once.|
|Menu||If the value is true, the context menu contains all commands: Play, Stop, Rewind etc. If false - About and Settings items only.|
|Movie||The URL or file name source for the Flash Player movie file. Setting this will load a new movie into the control.
1. Control does not check up the movie changes after loading, so re-loading with the same name is impossible. You should change the movie name or load an empty blank previously.
2. Empty file name raises an exception error.
|Quality||The current rendering quality (0 = Low, 1 = High, 2 = AutoLow, 3 = AutoHigh).
This is the same as the Quality2 property.
|Quality2||The current rendering quality. String: 'Low', 'Hight', 'AutoLow' or 'AutoHight'.|
|ReadyState r/o||0 = Loading, 1 = Uninitialized, 2 = Loaded, 3 = Interactive, 4 = Complete.|
|SAlign||String value is either 'L', 'T', 'R', 'B' or any combination (LR, LT, TR, LTR, LB, RB, LRB, TB, LTB, TRB, LTRB).
'L', 'R', 'T' and 'B' align the movie along the left, right, top or bottom edge, respectively, of the browser window and crop the remaining three sides as needed.
'TL' and 'TR' align the movie to the top left and top right corner, respectively, of the browser window and crop the bottom and remaining right or left side as needed.
'BL' and 'BR' align the movie to the bottom left and bottom right corner, respectively, of the browser window and crop the top and remaining right or left side as needed.
See also AlignMode
|SeamlessTabbing||The default value is true; set this parameter to false to disable "seamless tabbing", which allows users to use the Tab key to move keyboard focus out of a Flash movie and into the surrounding HTML (or the browser, if there is nothing focusable in the HTML following the Flash movie).
Note: Requires Adobe Flash Player 7 or later.
|Scale||String value - 'ShowAll', 'NoBorder', 'ExtractFit', 'NoScale', 'Low', 'AutoLow', 'AutoHight', 'Hight', 'Best', 'AutoMedium', 'Medium'
Show all (default) makes the entire movie visible in the specified area without distortion, while maintaining the original aspect ratio of the movie. Borders may appear on two sides of the movie.
No Border scales the movie to fill the specified area, without distortion but possibly with some cropping, while maintaining the original aspect ratio of the movie.
Exact Fit makes the entire movie visible in the specified area without trying to preserve the original aspect ratio. Distortion may occur.
|ScaleMode||Integer value from range 0..10. Value is the same as Scale.
0 - ShowAll, 1 - NoBorder, 2 - ExtractFit, 3 - NoScale, 4- Low, 5 - AutoLow, 6 - AutoHight, 7 - Hight, 8 - Best, 9 - AutoMedium, 10 - Medium
|Playing||True if the movie is currently playing, false if it is paused.|
|TotalFrames r/o||Returns the total number of frames in the movie. This is not available until the movie has loaded. Wait for ReadyState = 4|
|WMode||Wide string - 'window', 'opaque', 'transparent'. Sets the Window Mode property of the Flash movie for transparency, layering, and positioning in the browser.
'Window' movie plays in its own rectangular window on a web page.
'Opaque' the movie hides everything on the page behind it .
'Transparent' the background of the HTML page shows through all transparent portions of the movie, this may slow animation performance.
Note: This property is not supported in Delphi.
|Back||Go to the previous frame.|
|Forward||Go to the next frame.|
|GetVariable (const name: WideString): WideString;|
|Returns the value of the Flash variable specified by name. Raises an exception error if the variable does not exist.|
|GotoFrame (FrameNum: Integer);|
|Activates the frame number specified by FrameNum in the current movie. If the data for a requested frame is not yet available, the player goes to the last frame available and stops, causing unexpected results during playback. The argument FrameNumber is zero-based; that is, frameNumber is 0 in the first frame of the movie, 1 for the second frame, and so on. This differs from the Goto action within Flash, which begins at 1.|
|CurrentFrame||Returns the value number of current frame|
|LoadMovie (layer: SYSINT; const url: WideString);|
|Loads the movie identified by url to the layer. The argument type is integer for layer and string for url.|
|Pan (x: Integer; y: Integer; mode: SYSINT);|
|Pans a zoomed-in movie to the coordinates specified by x and y. Use mode to specify whether the values for x and y are pixels or a percent of the window. Pan does not pan beyond the boundaries of the zoomed-in movie. The argument type for all arguments is integer. The mode can be: 0 = pixels, 1 = % of window.|
|PercentLoaded||Returns the percent of the Flash Player movie that has streamed into the browser so far; possible values are from 0 to 100.|
|Play||Starts playing the animation.|
|Rewind||Go to the first frame.|
|Stop||Stops playing the movie.|
|StopPlay||Is the same as Stop.|
|SetVariable (const name: WideString; const value: WideString);|
|Sets the value of the Flash variable specified by name to the value. Type of both arguments is string.|
|SetZoomRect (left: Integer; top: Integer; right: Integer; bottom: Integer);|
|Zoom in on a rectangular area of the movie. Note that the units of the coordinates are in twips (1440 units per inch). To calculate a rectangle in Flash, set the ruler units to Points and multiply the coordinates by 20 to get TWIPS.|
|TCallFrame (const target: WideString; FrameNum: SYSINT);|
|In the timeline specified by target, executes the action in the frame specified by FrameNum.|
|TCallLabel (const target: WideString; const label_: WideString);|
|In the Timeline indicated by target, executes the action in the frame specified by the label_ frame label. The argument type for both arguments is string.|
|TCurrentFrame (const target: WideString): Integer;|
|Returns the number of the current frame for the timeline specified by target. The frame number returned is zero-based, meaning frame 1 of the Flash movie would be 0, frame 2 would be 1, and so on. The argument type is string.|
|TCurrentLabel (const target: WideString): WideString;|
|Returns the label of the current frame of the timeline specified by target. If there is no current frame label, an empty string is returned. The argument type is string.|
|TGetProperty (const target: WideString; property_: SYSINT): WideString;|
|Returns a string indicating the value specified by property_ for the timeline indicated by target.
The table shows the accessible properties.
|TGetPropertyAsNumber (const target: WideString; property_: SYSINT): Double;|
|Returns a number indicating the value specified by property_ for the timeline indicated by target. See TGetProperty.|
|TGotoFrame (const target: WideString; FrameNum: Integer);|
|For the timeline indicated by target, goes to the frame number specified by frameNumber.|
|TGotoLabel (const target: WideString; const label_: WideString);|
|For the timeline indicated by target, goes to the frame label_ specified by label. The argument type for both arguments is string.|
|TPlay (const target: WideString);|
|Plays the timeline specified by target. The argument type is string.|
|TSetProperty (const target: WideString; property_: SYSINT; const value: WideString);|
|For the timeline indicated by target, sets the value of the property specified by property_ to the value. See TGetProperty.|
|TStopPlay (const target: WideString);|
|Stops the timeline specified by target. The argument type is string.|
|Zoom (percent: SYSINT);|
|Zoom the view by a relative scale factor. Zoom(50) will double the size of the objects in the view. Zoom(200) will reduce the size of objects in the view by one half.|
|FSCommand (ASender: TObject; command, args: string);|
|This event is generated when a GetURL action is performed in the movie with a URL and the URL starts with "FSCommand:". The portion of the URL after the : is provided in command and the target is provided in args. This can be used to create a response to a frame or button action in the Shockwave Flash movie.|
|OnProgress (ASender: TObject; percentDone: Integer);|
|Generated as the Flash Player movie is downloading.|
|OnReadyStateChange (ASender: TObject; newState: Integer);|
|Generated when the ready state of the control changes. The possible states are 0=Loading, 1=Uninitialized, 2=Loaded, 3=Interactive, 4=Complete.|
Actually TShockwaveFlash and some its methods do not always work correctly. For example, the movie does not stretch automatically resizing of a parent window; property Menu does not make disabled the popup menu completely; property PopupMenu does not show the custom menu. Some tips how to expand the TShockwaveFlash possibilities are below.
Fixed visual bugs with resizing
TShockwaveFlash = class (TOleControl) ... public Procedure CreateWnd; override; ... Procedure TShockwaveFlash.CreateWnd; begin inherited; end; // in main unit Procedure TMain.OnResize (sender: TObject); begin ShockwaveFlash.CreateWnd; end;
Removing popup menu
TShockwaveFlash = class (TOleControl) ... protected procedure WndProc(var Message:TMessage); override; ... procedure TShockwaveFlash.WndProc(var Message:TMessage); begin if not (csDesigning in ComponentState) then begin if ( Message.Msg = WM_RBUTTONDOWN ) and (not Menu) then begin Message.Result := 0; end else inherited WndProc(Message); Exit; end; inherited WndProc(Message); end;