Flash as3/as2 flash full screen and exit code

Source: Internet
Author: User


FLASH exit code

The code is as follows: Copy code

On (release ){
Fscommand ("quit", true)
}

Add it to the button!

-------------------------------------------

The code is as follows: Copy code

On (release ){
Fscommand ("quit ");
}

You can disable playback with Flash Player.

Use

The code is as follows: Copy code

On (release ){
GetURL ("javascript: window. close ()");
}

You can disable flash enabled with IE.

**************************************** ***

Full Screen flash code

1. Type of Flash Player playback without a browser:

A. Do not display full screen (similar to screen saver effect) on the Flash player menu bar. Use the FSCommand command at the first frame,

In the Forstandaloneplayer option, set fullscreen to true. You can press ESC to exit or set a button

Use FScommand on Actions and select quit in the Forstandaloneplayer option to exit. Note:

The options on Forstandaloneplayer are only suitable for playback with Flash Player.

B. If you only want to fill the Flash Player window with SWF files, you do not need to do anything. Directly click the SWF file.

The preceding full screen mode is used for non-network operations.

2. The second type is full screen running in non-FLASH browsers (such as IE:

A. Only fill the browser: This situation is relatively simple, no matter whether the FLASH you set is 800*600, as long as you call the SWF file in the HTML file

Set the two parameters after WIDTH = HEIGHT = 100. Of course, you can also set them in the settings of the HTML file exported from FLASH,

Method: Open the FILE menu: Select PublishSettings to bring up the export settings dialog box: in the Dimensions option under the HTML tag

Select Percent from the drop-down list and enter 100 in the WIDTH and HEIGHT boxes. Run the HTML file with the same name as SWF and add the statement directly.

Effect. The full screen of the browser is irrelevant to the settings of the SWF file, but it is best to set the size near 700*400. Otherwise, the image may be easily caused.

Especially Chinese characters.

B. Full screen display of the browser menu bar and toolbar is not displayed. This kind of full screen is a little complicated and has nothing to do with FLASH settings, but it must be implemented using javacrip.

Complete. Add the following code between

The code is as follows: Copy code

<Criptlanguage = "javacrept">
<! --
Window. open ("nfd.swf", "", "fullscreen = 1, menubar = no, width = 800, height = 600 ")
// -->
</Dependency>

Note: change nfd.swf to the SWF file name you want to play.

You can also add:

The code is as follows: Copy code

Javacrept: window. open ("nfd.swf", "", "fullscreen = 1, menubar = no, width = 800, height = 600 ")

Note: change nfd.swf to the SWF file name you want to play.

Such full screen protection is similar to screen saver. Exit with ALT + F4 or the set button. Set fullscreen to = 0, but the full screen of the browser menu bar and toolbar is not displayed.

When playing with FLASH player, you can use CTRL + F to play full screen even if FSCOMMAND is not set.

The code is as follows: Copy code

Fscommand ("fullscreen", "true ");
Fscommand ("allowscale", "false ");

The implementation method of as3 is much simpler than that of as2.

// Full screen

The code is as follows: Copy code
Stage. displayState = StageDisplayState. FULL_SCREEN

// Click Btn_goNormal to exit full screen

The code is as follows: Copy code
Btn_goNormal.addEventListener (MouseEvent. MOUSE_DOWN, goNormal );
Function goNormal (event: MouseEvent): void
{
Stage. displayState = StageDisplayState. NORMAL;
}

// Click Btn_quit to disable the player.

The code is as follows: Copy code

Btn_quit.addEventListener (MouseEvent. MOUSE_DOWN, quit );
Function quit (event: MouseEvent): void
{
Fscommand ("quit ");
}

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.