Shockwaveflash control details

Source: Internet
Author: User
Tags file url rewind

Shockwaveflash controls (1) --- attributes ()

Attribute:
1. alignmode (read/write)
Syntax: alignmode as long
Note: Alignment mode is associated with the salign attribute. When the length/width ratio of the control is different from that of the video and the wmode is not exactfit, the position of the video (not enlarged) displayed in the control can be adjusted with this attribute. This attribute value is composed of flag spaces ., When the bits corresponding to the attribute value (Binary) are marked as 1, the corresponding alignment direction is set. The alignment between the property value and the corresponding alignment. It is the binary number in the brackets.
1: left aligned (0001)
2: Right aligned (0010)
4: Top alignment (0100)
8: Bottom alignment (1000)
You can also combine various alignment modes and Mark Two or more bits as 1, that is, add these four basic values. For example, if both the left alignment and the top alignment are performed, the attribute value is set to 5 (0101 ).
Example: set the right alignment of a video:
Movie. alignmode = 2

2. salign (read/write)
Syntax: salign as string
Description: alignmode (associated with alignmode ). When alignmode
The salign value is also set
The combination of "L" (left), "T" (top), "R" (right), and "B" (bottom) characters. The sequence of 'l', 't', 'R', and 'B' remains unchanged.
Example: Set the left and top alignment of a video:
Movie. salign = "LT"

3. backgroundcolor (read/write)
Syntax: backgroundcolor as long
Description: background color of the video (associated with bgcolor ). The color value is calculated using (red X 65536 + green x 256 + blue. The value range is 0-255 ). The default video background color is-1. If you set the background color or image as the background, you cannot see the effect of the attribute value change.
Example: Set the background color of a video to Blue:
Movie. backgroundcolor = 255

4. bgcolor (read/write)
Syntax: bgcolor as string
Description: the background color of the video (associated with backgroundcolor ). Unlike backgroundcolor, bgcolor is a six-digit hexadecimal number. Each two represents a red, green, and blue color respectively. For example, ffeeaa indicates that the red value is FF, the green value is EE, and the blue value is aa.
Example: Set the background color of a video to Red:
Movie. bgcolor = "ff0000"

5. Base (read/write)
Syntax: Base as string
Description: Specify the base address used to resolve all relative paths in the video. This attribute is particularly useful when a video is not in the same directory as other files you need. If this parameter is not specified, the Base Value defaults to ".", which is the path of the current video.
Example:
Movie. base = "http: // www.domain.com/pathname1/pathname2"

6. Movie (read/write)
Syntax: movie as string
Description: The Path of the video to be played (URL ). Setting this property as a SWF File URL will load the file and play it back. If the video is on a local hard disk, it must be written as the absolute path starting from the drive letter; if the video is on a website, it must also be written with a full URL address.
Example:
Movie. Movie = "http://www.domain.com/path1/path2/filename.swf"
Or
Movie. Movie = "C: \ temp \ test.swf"

7. devicefont (read/write)
Syntax: devicefont as Boolean
Determines whether to use the embedded font of the video. The default value is false. If this attribute value is set to true, the player is forced to use the local system font instead of the embedded font in the video.
Example:
Movie. devicefont = true

8. embedmovie (read/write)
Syntax: embedmovie as Boolean
Determines whether a video is stored in the container where the control is located. When you have loaded a video and set this attribute to true, you do not have to read the SWF file when playing the video. This makes it easier to use flash videos in PowerPoint presentations or vbprograms. However, if this attribute is set to true, the movie attribute of the control will no longer accept new values. To play another video (assign a new value to the movie attribute), you must set the embedmovie attribute to false first.
Example:
Movie. embedmovie = true

9. framenum (read/write)
Syntax: framenum as long
Description: Number of the current video frame (counted from 0 ). Setting this attribute value will stop the video at the frame specified by framenum.
Example: display the current number of frames:
Msgbox "currently displays the" & movie. framenum & "frame. "

Display a video with 10th frames:
Bomovie. framenum = 9

10. totalframes (read-only)
Syntax: totalframes aslong
Returns the total number of frames in a video. This parameter is valid only after the video is loaded (readystate = 4 ).
Example:
If movie. readystate = 4 then msgbox "this video has a total of" & movie. totalframes & "frames. "

11. Loop (read/write)
Syntax: loop as Boolean
Indicates whether loop playback is enabled. If it is set to true, it indicates loop playback. If it is set to false, playback is performed only once.
Example:
Movie. Loop = true

12. menu (read/write)
Syntax: menu as Boolean
Indicates whether to display menus. If it is set to true, all menus are displayed. If it is set to false, the menu is blocked, but there is still an item "about Macromedia flashplayer ...". If you really don't like this menu, you should intercept the mouse message in the program. Unlike in an independent Flash Player, click
"About..." will open the browser and go to Macromedia's website to see about.
Example:
Movie. Menu = false

13. Playing (read-only)
Syntax: playing as Boolean
Note: The current playback status. If the video is being played, the value of this attribute is true; otherwise, the value is false.
Example:
If movie. Playing = false then msgbox "the video has been stopped! "

14. Quality (read/write)
Syntax: quality as long
Note: Image Quality (associated with quality2 ). Quality can be:
0 -- equivalent to taking "low" for quality2"
1 -- equivalent to "high" for quality2"
2 -- equivalent to quality2 to "autolow"
3 -- equivalent to quality2 to "autohigh"
Example:
Movie. Quality = 1

15. quality2 (read/write)
Syntax: quality as string
Note: Image Quality (associated with quality ). Quality2 can be used as follows:
Low: focuses on the playback speed, regardless of the display effect, and is not enabled
This function can be used to remove teeth.
High: focuses on the screen, regardless of the playback speed, and always enables the anti-aliasing function. If an animation is not included in a video, the bitmap is processed smoothly. If an animation exists, the bitmap is not processed smoothly. (The animation here should be to translate or rotate an image)
Autolow: focuses on playback speed, but the display effect can be improved as long as it is possible. The anti-aliasing function is disabled at the beginning of playback. If the player detects that the processor is sufficient, enable the anti-aliasing function.
Autohigh: At the beginning, the playback speed and display effect are both equal, but the image quality is sacrificed to ensure the speed if necessary. Enable the anti-aliasing function when playing the video. However, if the actual frame rate is slower than the specified frame rate at the design time, the playback speed will be improved by disabling the anti-aliasing function.
Example:
Movie. quality2 = "high"

16. readystate (read-only)
Syntax: readystate as long
Note: The Current Status of the video. Readystate can be set:
0 -- Loading
1 -- not initialized
2 -- loaded
3 -- interacting
4 -- Example of completion:
If movie. readystate = 4 then msgbox "the video has been loaded! "

17. Scale (read/write)
Syntax: scale as string
Description: Scaling mode (associated with scalemode ). Scale:
Showall -- display all the film regions in the control, and keep the film length and width ratio unchanged. The size of the film is determined by the side of the control length or width smaller.
Noborder-display part of the video area in the control to keep the length and width ratio unchanged. The size of the video is determined by the side of the control length or width.
Exactfit -- display all video regions in the control, and force the length-width ratio of the video to the length-width ratio of the control.
Example:
Msgbox "Current scaling mode is:" & movie. Scale

18. scalemode (read/write)
Syntax: scalemode as long
Description: Scaling mode (associated with scale ). Scalemode:
0 -- equivalent to scale to get "showall"
1 -- equivalent to scale to get "noborder"
2 -- equivalent to "exactfit" for Scale"
Example: Change the zoom mode of a video to "exactfit ":
Movie. scalemode = 2

19. Stacking (read/write)
Syntax: Stacking as string
Note: For HTML, when Flash Player is used as an "action" in HTML, this attribute determines how the Flash video is displayed relative to the HTML content referenced by it. (For more information about "behavior", see the style sheet ). Stacking can be used to obtain:
None -- "action" is not displayed.
Replaceall -- display of "behavior" replaces the content of all other elements, including the background.
Content -- the display of "behavior" only replaces the content of other elements.
Background -- display of "behavior" only replaces the background of other elements.
Below -- "behavior" is displayed under all other elements.
Belowflow -- "behavior" is displayed on the sub-objects of other elements in reverse Z order, but on the main content of the element.
Aboveflow -- "behavior" is displayed under the sub-objects of other elements in the forward Z sequence, but above the main content of the element.
Above -- "behavior" is displayed on the content of all other elements.
Top -- display of "behavior" is placed above the content of the entire page.
Example:
Movie. Stacking = "below"

20. wmode (read/write)
Syntax: wmode as string
Note: The control window mode. Wmode can be set to the default value of window -- wmode attribute. Press
A typical way to work is to play a video in the control's rectangular window, which can provide the fastest animation effect.
Opaque -- make the video opacity. Transparent -- create a transparent video. If the video contains
Transparent fragment. When put here, you can see the background under the control. However, when this attribute value is used, the playback speed of the animation may be slower.
Example:
Movie. wmode = "Transparent"

 

 

Shockwaveflash controls (2) --- Methods and events (transfer)

Method:

The following method does not return values:
1. Back
Syntax: Back ()
Note: The video is moved back and stops playing. Example:
Movie. Back

2. Forward
Syntax: Forward ()
Note: The video goes forward and stops playing.
Example:
Movie. Forward

3. gotoframe
Syntax: gotoframe (framenum as long)
Note: The video is redirected to a frame specified by framenum and the video is stopped. If the specified frame has not been loaded, the player moves forward to the final available frame and stops. unexpected consequences may occur during the call process. It is best to use the percentloaded method to determine whether sufficient films have been loaded to execute this method. The parameter framenum starts from 0, which is different from the Goto action in flash. It starts from 1.
Example: Jump to the 20th frame of a video:
Movie. gotoframe 20

4. loadmovie
Syntax: loadmovie (layer as long, URL as string)
Note: The video specified by the URL is loaded to the layer specified by the layer.
Example: Load movie.swf to layer 0:
Movie. loadmovie 0, "movie.swf"

5. Pan
Syntax: Pan (X as long, y as long, mode as long)
Note: the translation of an enlarged video is determined by the distance specified by X and Y. Both X and Y are relative values. That is, the distance between the control and the video (you can imagine that the control is a window, and the video is a set that we see from the window outside, we can see that the windows have some translation distance from the set. That is, the outside set is moving, while the windows are not moving ). Use the mode parameter to specify whether the values of X and Y are pixels or the percentage of windows. When mode = 0, the coordinate system is in pixels; when mode = 1, the coordinate system is calculated as the percentage of the window. The pan operation cannot exceed the frame of the video. That is to say, the pan operation in one direction can reach the maximum degree of alignment between the edge of the video and the control.
Example: The control translates 5 pixels from the left to the right of the video (when the control does not move, the video is translated to the right ):

6. Play
Syntax: Play ()
Starts to play a video.
Example:
Movie. Play

7. Rewind
Syntax: rewind ()
Note: rewind. Returns the first frame of the video.
Example:
Movie. Rewind

8. setvariable
Syntax: setvariable (name as string, value as string)
Note: Set the flash variable value specified by name to value.
Example:
Movie. setvariable "/form: username", "John Smith"
---------------------------------------------------------------------------
Event:

1. fscommand
Syntax: shockwaveflash1_fscommand (byval command as string, byval ARGs asstring)
Events triggered by calling fscommand () in Flash
Parameters:
Command: indicates the command ID.
ARGs: Parameter
Example:
Select case command 'Here we can use if
'However, if the command is too large, it will be difficult to use it.
'I am doing a demonstration.
Case "command1"

If ARGs = "123" then

...

Else

...

End if

Case...

End select

2. flashcall
Syntax: shockwaveflash1_flashcall (byval request as string)
Note: Few people may know the usefulness of this event. In fact, this event is similar to the fscommand event. Unlike fscommand, this event can return values (as described below)
The parameter is a string in XML format. The format is
"<Invoke name = '% s' returntype = 'xml'> <arguments> <string> % S </string> </arguments> </invoke> ", check the help information.
Processing request: the standard VB does not have a library for processing XML. You can find a plug-in that supports XML. The following describes how to process the request as needed.
Return Value:
The event handler function does not return values, but flashplayer provides a method: shockwaveflash1.setreturnvalue () to specifically pass the returned values, the format is <string> % S </string> (it can also be another as structure. For more information, see help ).
Example: here is an example of tinyxml:
Private sub shockwaveflash1_flashcall (byval request asstring)

Dim request_xml as new tixmldocument
Dim request_name as string

Request_xml.parse request
Request_name = request_xml.rootelement (). Attribute ("name ")

... Handle it by yourself.

End sub

3. onprogress
Syntax: shockwaveflashpoliconprogress (byval percentdone as long)
Note: It is estimated that the flash is triggered when the loading progress changes?
Percentdone should be a percentage ~
I haven't caught this event yet... =!

4. onreadystatechange
Syntax: shockwaveflashpoliconreadystatechange (newstate as long)
Note: As the name implies, it is the event triggered when the readystate changes. For details, refer to the preceding description of the readystate attribute. I will not talk nonsense here ....

For other events, such
Gotfocus and lostfocus. I don't want to talk nonsense either...

 

 

PS: The corresponding class of the shockwave flashobject control is the cshockwaveflash class, which has the following common functions:

Play () Play an animation         Stopplay () Stop Animation       Isplaying (): whether the animation is playing (true, false)

Gotoframe (frame_number) jump to a frame (frame_number + 1)                  

Totalframes () gets the total number of frames of an animation.              Currentframe () returns the number of frames of the current animation-1 

Rewind ()Returns the first frame of the animation.                 Setzoomrect (left, top, right, buttom) to enlarge the specified area

Zoom (percent) changes the animation size               Pan (x_position, y_position, Unit)Make the animation pan in the X and Y directions

Percentloaded () returns the percentage of animation loaded (0-100)

Loadmovie (level_number, PATH) Load Animation

Tgotoframe (movie_clip, frame_number) Movie_clip jump to the specified number of frames
Tgotolabel (muvie_clip, label_name)     Jump to the specified tag using movie_clip
Tcurrentframe (movie_clip)Returns the current movie_clip frame-1.

Tcurrentlabel (movie_clip) returns the current movie_clip label

Tplay (movie_clip)Play movie_clip          Tstopplay (movie_clip)Stop playing movie_clip

Getvariable (variable_name) Get variable   Setvariable (variable_name, value)Variable assignment

Tcallframe (movie_clip, frame_number)Call specifies the action on the frame

Tcalllabel (movie_clip, label)Call specifies the action on the tag

Tgetproperty (movie_clip, property)Obtain the specified attributes of movie_clip.

Tsetproperty (movie_clip, property, number)    Set the specified attributes of movie_clip

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.