Winform (C #) Flash Control Property Method event

Source: Internet
Author: User
Tags rewind

My user control-right-click Add/Remove Item-"COM component-" ShockwaveFlash Object tick

Property:

1.AlignMode (read/write)

Syntax: Alignmodeas Long

Description: Alignment (linkage with Salign property). When the height-to-width ratio of a control is inconsistent with the movie and WMode is not exactfit, the position of the movie (not magnified) in the control can be adjusted by that property. The property value consists of a flag bit. , set the corresponding alignment direction by marking the corresponding bit in the attribute value (binary) as 1.

The property value is aligned with the corresponding alignment (binary number in parentheses)

1: Align Left (0001) 2: Align Right (0010)

4: Top-aligned (0100) 8: Bottom-aligned (1000)

You can also combine the various alignments and mark two or more bits as 1, which is the combination of the four base values. For example, left and top aligned at the same time, the attribute value is set to 5 (0101).

Example: Set the movie to right: movie. Alignmode = 2

2.BackgroundColor (read/write)

Syntax: Backgroundcoloras Long

Description: The background color of the film (linked with bgcolor). Calculates the color value (red x65536+ green x256 + blue). The value range of red, green and blue color (0-255). The default movie background color is-1. If the movie has an undertone or a picture as the background, then it doesn't see how the change in the property value will affect it.

Example: Set the movie background color to blue:

Movie. BackgroundColor = 255

3.Base (read/write)

Syntax: Base asstring

Description: Specifies the base address of the declaration that is used to resolve all relative paths in the movie. This property is especially useful when the movie is not in the same directory as the other files it needs. If not specifically specified, the value of Base defaults to ".", which is the path where the current movie is located.

Example:

Movie. Base = "Http://www.domain.com/pathname1/pathname2"

4.BGColor (read/write)

Syntax: BGColor asstring

Description: The background color of the film (linked with BackgroundColor). Unlike BackgroundColor, BGColor is a six-digit hexadecimal number, each of which represents a red-green-blue color value. For example: FFEEAA indicates that the red value is FF, the green value is EE, and the blue value is AA.

Example: Set the movie background color to red:

Movie. BGColor = "FF0000"

5.DeviceFont (read/write)

Syntax: Devicefontas Boolean

Description: Determines whether to use the font embedded in the movie, and the default value is False. Setting this property value to True forces the player to use the Local system font without using the fonts embedded in the movie.

Example: Movie. Devicefont= True

6.EmbedMovie (read/write)

Syntax: Embedmovieas Boolean

Description: Whether the movie is stored in the container where the control resides. Set this property to True when you have loaded a movie, and you do not have to read the SWF file when you play the movie. This makes it easier to use Flash movies in PowerPoint presentations or VB programs. However, when this property is set to True, the Movie property of the control no longer accepts the new value. To play another movie (assigning a new value to the movie property), you must first set the Embedmovie property to False.

Example: Movie. Embedmovie = True

7.FrameNum (read/write)

Syntax: Framenum aslong

Description: The number of the current frame of the movie (counting starting from 0). Setting this property value will cause the movie to stop at the frame specified by Framenum.

Example: Display the current number of frames: MsgBox "Current display is" & movie. Framenum & "frame. "

Make the Movie show frame 10th: bomovie.framenum = 9

8.Loop (read/write)

Syntax: Loop Asboolean

Description: Whether to loop playback. Set to True to loop playback, set to False to play only once.

Example: Movie. Loop = True

9.Menu (read/write)

Syntax: Menu Asboolean

Description: Whether the menu is displayed. Set to True to show all menus, set to False the menu is masked, but there is still a "about Macromedia flashplayer ...". If you really do not like this menu, you should stop the mouse messages in the program to achieve the goal. Unlike in the standalone F L a s H player, the "about ..." point in the right-click menu of the control will open the browser to Macromedia's website to see about it.

Movie. Menu = False

10.Movie (read/write)

Syntax: Movie asstring

Description: The movie path (URL) to play. Setting this property to the URL of a SWF file will load the file and play it. If the movie is on a local hard drive, write the absolute path starting from the drive letter, and if the movie is on a Web site, the full URL is also written.

Example:

Movie. Movie= "http://www.domain.com/path1/path2/filename.swf"

or movie. Movie= "c:\temp\test.swf"

11.Playing (Read only)

Syntax: Playing Asboolean

Description: The current playback state. True If the movie is playing, False otherwise.

Example: If movie. Playing = False then MsgBox "The movie has stopped playing!" "

EndIf

12.Quality (read/write)

Syntax: Quality Aslong

Description: Picture quality (linkage with Quality2). Quality can take:

0--equivalent to Quality2 "low"

The equivalent of Quality2 take "high"

2--equivalent to Quality2 take "Autolow"

3--equivalent to Quality2 take "Autohigh" Example: Movie. Quality = 1

13.quality2 (Read and write)

Syntax: Quality asstring

Description: Picture quality (linkage with quality). Quality2: Low: Focuses on playback speed regardless of display effect, and does not enable anti-aliasing.

High: Focus on the screen regardless of playback speed and always enable anti-aliasing. If the movie does not contain animations, the bitmap is smoothed, and if there is an animation, the bitmap is not smoothed. (The animation here should be to translate or rotate a picture.)

Autolow: Focus on playback speed first, but improve the display if possible. Disables the anti-aliasing feature first when playback starts. If the player detects that the processor is capable of withstanding, enable anti-aliasing.

Autohigh: At first, the playback speed and the display effect are both equal, but sacrificing picture quality to ensure speed if necessary. Anti-aliasing is enabled when you start playback. However, if the actual frame rate is slower than the rate specified at design time, the anti-aliasing feature is disabled to improve playback speed.

Example: Movie. Quality2 = "High"

14.ReadyState (Read only)

Syntax: Readystateas Long

Description: The current state of the movie. ReadyState can take:

0--is loading

Not initialized

2--Loaded

3--is interacting

4--Complete Example:

Ifmovie.readystate = 4 Then

MsgBox "Movie Loading complete! "End If

15.SAlign (read/write)

Syntax: Salign asstring

Description: Alignment mode (linkage with Alignmode). When Alignmode

The Salign value is also set to a combination of "L" (left), "T" (Top), "R" (right), "B" (Bottom) characters when the bits that represent each alignment mode are placed "1". (The order of ' L ', ' T ', ' R ', ' B ' is the same)

Example: Set the movie to align Left and top: movie. Salign = "LT"

16.Scale (read/write)

Syntax: Scale asstring

Description: Zoom mode (linkage with ScaleMode). Scale can take:

showall--displays all movie areas within the control, keeping the movie's length-to-width ratio constant, and the size of the movie depends on the smaller side of the control's length or width.

noborder--displays part of the movie area within the control, keeping the movie's length-to-width ratio constant, and the size of the movie depends on the length of the control or the larger side of the width.

exactfit--Displays the entire movie area within the control, forcing the length-to-width ratio of the movie equal to the height-to-width ratio of the control.

Example: MsgBox "The current zoom mode is:" & Movie. Scale

17.ScaleMode (read/write)

Syntax: Scalemodeas Long

Description: Zoom mode (linkage with scale). ScaleMode can take:

0--equivalent to scale "showall"

The equivalent of the scale of "Noborder"

2--equivalent to scale "Exactfit"

Example: Change the zoom mode of a movie to "Exactfit": Movie. Scalemode= 2

18.Stacking (read/write)

Syntax: Stacking asstring

Description: Used for HTML, which uses Flash Player as a "behavior" in HTML, determines how the Flash movie is displayed relative to its referenced HTML content. (for behaviors, see the style sheet's data). Stacking can take:

none--"Behavior" is not displayed.

replaceall--the display of "behavior" supersedes the contents of all other elements, including the background.

content--the display of "behavior" replaces the contents of other elements only.

background--the display of "behavior" replaces the background of other elements only.

below--"Behavior" is displayed below the content of all other elements.

belowflow--"Behavior" is displayed in reverse Z-order on the child objects of other elements, but above the main content of the element.

aboveflow--"Behavior" is displayed in a positive Z-order below the sub-object of another element, but above the main content of the element.

above--"Behavior" is displayed above the content of all other elements.

The display of top--"behavior" is placed above the entire page content.

Example: Movie. Stacking = "Below"

19.TotalFrames (Read only)

Syntax: Totalframesas Long

Description: Returns the total number of frames in the movie. This parameter is valid until the movie loading is complete (readystate=4).

Example: If movie. ReadyState = 4 Then

MsgBox "The film in Common" & movie. Totalframes & "frame. "

End If

20.WMode (read/write)

Syntax: WMode asstring

Description: The window mode of the control. Wmode can take:

The default value of the Window--wmode property, which works as a typical Flash player, is to play the movie in the control's rectangular window, which generally provides the fastest animation effect.

opaque--make the movie opaque. transparent--create a transparent movie. If the movie has

Transparent fragments, when placed here, you can see the background under the control. But with this property value, the animation may play slower.

Example: Movie. WMode = "Transparent"

Method:

1.Back

Syntax: Back ()

Description: The movie backs up one frame and stops playing.

Example: Movie. Back

2.Forward

Syntax: Forward ()

Description: The movie advances one frame and stops playing.

Example: Movie. Forward

3.GotoFrame

Syntax: Gotoframe (framenumas Long) Description: Jumps the movie to the frame specified by Framenum, and

Stops playback. If the specified frame is not loaded, the player advances to the last available frame and stops, which can have unpredictable consequences during the call. It is a good idea to use the Percentloaded method to determine whether enough movies have been loaded to perform this method. The parameter framenum is starting from 0, which is not the same as the Goto action in Flash, it starts with 1.

Example: Jump to the 20th frame of the movie: Movie. Gotoframe 20

4.LoadMovie

Syntax: Loadmovie (layeras Long, url as String) Description: The movie specified by the URL is loaded into the layer specified by the layers.

Example: Loading the movie.swf into layer 0: movie. Loadmovie 0, "movie.swf"

5.Pan

Syntax: Pan (x Aslong, y as long, mode as Long) Description: Pans A zoomed-in movie by the distance specified by x and Y.

Both x and Y are relative values. That is, the distance the control is shifted relative to the movie (you can imagine the control is a window, the movie is the set that we see from the window, and we see that the window shifts some distance relative to the scene, that the outside scene is moving and the window is motionless).  Use the mode parameter to specify whether the value of x and Y is a pixel or a percentage of the window, and the coordinate system is measured in pixels when mode=0, and the coordinate system is calculated as a percentage of the window when mode=1. Panning does not extend beyond the frame of the movie, that is, the degree to which the edge of the movie is aligned to the control in one Direction.

Example: the control pans 5 pixels to the left of the movie (although the control does not move, the movie is shifted to the right): movie. Pan 5,5,0

6.Play

Syntax: Play ()

Description: Starts playing the movie.

Example: Movie. Play

7.Rewind

Syntax: Rewind ()

Description: Rewind the tape. Returns to the first frame of the movie.

Example: Movie. Rewind

8.SetVariable

Syntax: SetVariable (Nameas string, value as String) Description: Sets the value of the Flash variable specified by name to value.

Example: Movie. SetVariable "/form:username", "John Smith"

9.SetZoomRect

Syntax: Setzoomrect (Leftas long, top as long, right

As long, bottom as long)

Description: Enlarges the rectangle area specified in the movie to the size of the control. The coordinate values for left, top (top), right, and bottom (bottom) are calculated relative to the active position of the movie in the control. Note that this function is calculated from the upper-left corner of the active area of the movie, not the upper-left corner of the control.

Example: Enlarge the rectangular area of the 200x200 point from the upper-left corner of the movie:

PointsToTwips = 20;

Movie. Setzoomrect 0, 0, *pointstotwips, 200* pointstotwips

10.Stop

Syntax: Stop ()

Description: Stops playing the movie.

Example: Movie. Stop

11.StopPlay

Syntax: Stopplay ()

Description: Stops playing the movie.

Example: Movie. Stopplay

12.TCallFrame

Syntax: Tcallframe (Targetas String, Framenumas Long)

Note: In the time axis specified by t a r ge T, the action in the frame specified by Framenum is performed.

Example: To run the action of frame 5th in the main timeline: movie. Tcallframe "/", 4

13.TCallLabel

Syntax: Tcalllabel (Targetas string, label as String) Description: The action in the frame specified by the label is executed in the timeline specified by target.

Example: To run an action in a frame named "Handlescriptnotify" in the main timeline: movie. Tcalllabel "/", "handlescriptnotify"

14.TGotoFrame

Syntax: Tgotoframe (Targetas String, Framenum

As Long)

Description: For the time axis specified by t a r ge T, go to the frame specified by Framenum.

Example: Movie. Tgotoframe "/movieclip", 2

15.TGotoLabel

Syntax: Tgotolabel (target As String, label as String) Description: For the time axis specified by target, go to the frame specified by label.

Example: Movie. Tgotolabel "/movieclip", "MyLabel"

16.TPlay

Syntax: Tplay (targetas String) Description: Plays the timeline specified by target.

Example: Movie. Tplay "/movieclip"

17.TSetProperty

Syntax: Tsetproperty (Targetas string, property Aslong, value as String)

Description: For the time axis specified by target, set the property specified by the attribute to the value specified by value (string). property is a number that represents the corresponding attribute (see the attached table for details).

Example: Dim Nameindex as Long

Nameindex = 13

Movie. Tsetproperty "/movieclip", Nameindex,

"NewName"

18.TSetPropertyNum

Syntax: Tsetpropertynum (Targetas String, property as Long, value as Double)

Description: For the time axis specified by target, set the property specified by the attribute to the value (number) specified by value. property is a number that represents the corresponding attribute (see the attached table for details).

Example: Dim visibilityindex as Long visibilityindex = 7

Movie. Tsetproperty "/movieclip", Visibilityindex, 1

19.TStopPlay

Syntax: Tstopplay (Targetas String)

Description: Stops playback of the timeline specified by target.

Example: Movie. Tstopplay "/moviecliptostop"

20.Zoom

Syntax: Zoom (Factoras Long)

Description: Zooms the view by a relative percentage specified by factor. Factor can be understood as a percentage of the actual size of the movie you see from the control window. With factor set to 0, the view is restored to 100% size. The current view is already 100% and can no longer be scaled down.

Example: Enlarge the movie twice times: Movie. Zoom 50

The following methods all have return values:

21.CurrentFrame

Syntax: Currentframe () as Long

Description: Returns the current number of frames for the movie. The first frame of the movie is 0. Example: Dim framenow as Integer framenow =movie.currentframe

22.FlashVersion

Syntax: Flashversion () as Long

Description: Returns the control version number. The value has a total of three bytes, followed by the major, minor, and revision numbers. If I use the Flash player control with this method the return value is 3 2 7 7 2 2, equivalent to 16 binary

&H05002A, equivalent to 5.00.42.

Example: The following program shows the version number of the control you are using:

Dim Vernum, Majornum, Minornum, Revisionnumas Long

Vernum=movie. Flashversion

Majornum=vernum \ 65536

minornum= (vernum-majornum * 65536) \ 256

Revisionnum = Vernum Mod 256

MsgBox "The version number of your Flash player control:" & Majornum & "." &minornum & "." & Revisionnum

23.GetVariable

Syntax: getvariable (Nameas string) as String

Description: Returns the value of the Flash variable specified by name. Returns NULL if the variable does not exist.

Example:

Dim FirstName, radiobuttonvalue as Stringfirstname = movie. GetVariable "FirstName" Radiobuttonvalue =movie. GetVariable ("/form/radiobutton:value")

24, IsPlaying

Syntax: IsPlaying () as Boolean

Description: Returns True if the movie is playing.

Example: If movie. IsPlaying Then

MsgBox "The movie is playing! "

End If

25.PercentLoaded

Syntax: percentloaded () as Long

Description: Returns the percentage of movies that are currently loaded. Values range from 0 to 100.

Example:

Dim Loaded as Boolean

If movie. percentloaded = Loaded =true

End If

26.TCurrentFrame

Syntax: Tcurrentframe (Targetas String) as Long

Description: Returns the number of the current frame in the timeline specified by target. The returned frame number starts at 0, which means that the first frame of the movie is 0,

Two frames is 1, and so on.

Example:

Dim Currentframe as Long

Currentframe =movie. Tcurrentframe ("/movieclip")

27.TCurrentLabel

Syntax: Tcurrentlabel (Targetas string) as String

Description: Returns the label of the current frame in the timeline specified by target. If there is no label for the current frame, an empty string is returned.

Example:

Dim CurrentLabel as String

CurrentLabel =movie. Tcurrentlabel ("/movieclip")

28.TGetProperty

Syntax: Tgetproperty (Targetas string, property as Long) as String

Description: Returns the attribute value (string) specified by the property for the time axis specified by target. Where property is a number representing the corresponding attribute (see the attached table for details).

Example:

Dim nameindex As Long Dim name As Stringnameindex = all name = Movie. Tgetproperty ("/", Nameindex)

29.TGetPropertyNum

Syntax: Tgetpropertynum (Targetas String, property as Long) as Double

Description: Returns the attribute value (number) specified by the property for the time axis specified by target. Where property is a number representing the corresponding attribute (see the attached table for details).

Example:

Dim Framesloadedindex as Long dimframesloaded as Double framesloadedindex = framesloaded =movie. Tgetproperty ("/", Framesloadedindex)

Schedule: Gets and sets properties. The corresponding number of each property is available in Tgetproperty, Tgetpropertyasnumber, Tsetproperty, or Tsetpropertynum to indicate which property will be accessed.

Event:

1.FSCommand

Syntax: FSCommand (Commandas String, args as

String)

Description: The FSCommand action added to the movie in Flash can pass information from the movie to the Flash Player, the Flash Player, or the Web page or program that contains the player control, to perform the corresponding action based on the information obtained, thus achieving the internal and external application of the film Interoperability. For example, add the following Action to a button picture in F L a s H:

On (release) {

Fscommand ("fullscreen", "true");

}

When the Flash player clicks the button while the file is playing, the player switches to full-screen mode.

Here are the commands and their parameters that are recognized by the Flash player:

Command: Quit

Parameters: No Parameters

Function: Close player command: Fullscreen parameter: TRUE or False

Function: Set to True to enable the player to play in full-screen mode, and set to False to return the player to normal window mode.

Command: Allowscale

Parameter: TRUE or False

Function: Set to False will make the movie not change with the size of the player changes, always maintain the original size, equivalent to 100% in the Player menu, set to True to restore the movie with the size of the player to change the size, equivalent to Show all in the Player menu.

Command: ShowMenu

Parameter: TRUE or False

Function: Set to True to show all menus, including the menu bar and the right-click menu of the play area, set to false the menu bar is not displayed, the right-click menu in the play area has only one item "About Macromedia Flashplayer ...".

Command: EXEC

Parameters: The path and name of the application function: executes a specified application. As in Flash movies

The Add action is:

Fscommand ("exec", "regedit");

Performing this action when the player plays the movie opens the Registry Editor program. Note that the Flash-brought player will perform the corresponding action after receiving these commands, but there will be no reaction in the control, only the program can parse and program the received command and args in the FSCommand event.

2.OnProgress

Syntax: eventonprogress (PercentDone as Long)

Description: Occurs when a Flash movie is downloaded. PercentDone is the percentage of the movie that has been downloaded, from 0 to 100.

Example: Show download progress in the form title bar:

Private Sub movie_onprogress (byvalpercentdone as Long)

Form1. Caption = "movie Downloaded:" & percentdone& "%"

End Sub

3.OnReadyStateChange

Syntax: Eventonreadystatechange (newstate as

Long)

Description: Occurs when the control's readiness state changes. Below is a list of

NewState Possible values:

0--is loading

Not initialized

2--Loaded

3--is interacting

4--completed

Example: A message appears after the movie is loaded, and then starts to play the movie:

Private Sub Movie_onreadystatechange (newstateas

Long)

Ifnewstate = 4 Then

MsgBox "Movie Loading complete! & vbCrLf & Movie Total frames: & Movie. Totalframes

Movie. Play

End If

End Sub

Some examples are VB, but still can understand, it is not to write Flash Player words also can not use much

As long as a movie property and Play () method can be put flash in from

Here is a summary of the use of Flash control c#winform, I hope to give the same to flash not familiar with the people some help

It's really cool to use flash in Winfrom.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Winform (C #) Flash Control Property Method event

Related Article

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.