Using PB to realize Flash animation playback

Source: Internet
Author: User
Tags ole touch

1. Foreword

PowerBuilder (hereafter referred to as PB) is an object-oriented, rapid development database development platform, often used in database development, Flash animation not only contains animation, but also have a sound such as the formation of a very image of the dynamic screen, in the PB development of the program to add Flash animation, making the program more dynamic To create a more user-friendly interactive interface for users. The following is a way to animate the OLE control "Swflash.ocx" provided by Flash 5 in PB8.0 database programming.

2. Use of OLE controls in PB

Using the "Swflash.ocx" control in a PB8.0 environment, first create a window, then add an OLE control to the form, and use OLE to connect the FLASH 5 control "Swflash.ocx" as follows:

(1) Select Menu "Cotrols | OLE, displays the window Insert object, chooses insert control, and finds "Shockware FLASH object" in the control Tyle (if it is not registered, select Register Now) Register the control); go back to the PB window and click the mouse to place the control on the window and resize it.

(2) Use the main properties provided by the FLASH5.0 control "Swflash.ocx" in programming:

Movie property: The URL of the Flash animation file: Write the full directory name on the local disk or the address on the Internet by browsing the Web page, for example: f:\touch\start.swf.

Quality (resolution) Properties: playback resolution, with 0 (low), 1 (Autolow), 2 (Hight), 3 (Autohight), 4 (best) five values.

Scale property: The screen that plays, has 0 (showall), 1 (Noborder), 2 (exactfit) three values.

Loop (Loop Playback) property: True, False.

Menu (menu) property: True, False.

(3) According to the needs of the application programming, such as in the window "open" event, set the "Swflash.ocx" control of the property value, input the following code (or in the property page to fill in):

Ole_1.object.movie= "F:\ \touch\start.swf"

Ole_1.object.loop=true

Ole_1.object.quality=4

ole_1.object.scale=2

Ole_1.object.menu=true

3. PB Control Animation playback

The above set the control's properties, in the program can only play the generated animation file ("*.swf"), PB can not control the animation, to PB control Flash animation, you need to use the "Swflash.ocx" control methods and events.

(1) using the control "SetVariable" method can realize the display of dynamic text (for example, play a text in the animation "I Love Flash", change to "I Love" PB). The practice is as follows:

A to set the text field variable in the Flash animation.

Select the dynamically displayed text object in Flash, and select dynamic text in the Textoptions panel to set the Text field type. Then enter the field variable name in variable: "Disptext". In the text box, type "I love Flash"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.