How can I create the flash pixviewer.swf?

Source: Internet
Author: User

[Javascript]
<Script type = "text/javascript">
<! --
// The Flash Player (Wu yanwen) for picture Carousel in the page. The script is static and modified here.
Var interval_time = 5 // The pause time of the image, in seconds. If the value is 0, automatic switching is stopped.
Var focus_width = 400 // width
Var focus_height = 174 // height
Var text_height = 26 // Title height
Var text_align = 'center' // align the title text (left, center, right)
Var swf_height = focus_height + text_height // The sum of the values is preferably an even number. Otherwise, the number may be blurred.
// When the following three lines of code are added to a program, you can use tags to stack the code.

Var pics = 'images/01.jpg | images/02.jpg | images/03.jpg | images/04.jpg | images/05.jpg'
Var links = '#|##|#| #'
Var texts = 'title of the first image | title of the second image | title of the third image | title of the fourth image | title of the fifth image'
 
Document. write ('<object classid = "clsid: d27cdb6e-ae6d-11cf-96b8-444553540000" codebase = "http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width = "' + focus_width + '" height = "' + swf_height + '"> ');
Document. write ('<param name = "movie" value = "js/pixviewer.swf"> <param name = "quality" value = "high"> <param name = "bgcolor" value = "# DADADA"> ');
Document. write ('<param name = "menu" value = "false"> <param name = wmode value = "opaque"> ');
Document. write ('<param name = "FlashVars" value = "pics =' + pics + '& links =' + links + '& texts =' + texts + '& borderwidth =' + focus_width + '& borderheight =' + focus_height + '& textheight =' + text_height + '& text_align =' + text_align + '& interval_time =' + interval_time + '"> ');
Document. write ('<embed src = "js/pixviewer.swf" wmode = "opaque" FlashVars = "pics =' + pics + '& links =' + links + '& texts =' + texts + '& borderwidth =' + focus_width + '& borderheight =' + focus_height + '& textheight =' + text_height + '& text_align =' + text_align + '& interval_time =' + interval_time + '"menu =" false "bgcolor =" # ffffff "quality =" high "width ="' + focus_width + '"height ="' + swf_height + '"allowScriptAccess = "sameDomain" type = "application/x-shockwave-flash" pluginspage = "http://www.macromedia.com/go/getflashplayer"/> ');
Document. write ('</object> ');
// -->
</Script>

<Script type = "text/javascript">
<! --
// The Flash Player (Wu yanwen) for picture Carousel in the page. The script is static and modified here.
Var interval_time = 5 // The pause time of the image, in seconds. If the value is 0, automatic switching is stopped.
Var focus_width = 400 // width
Var focus_height = 174 // height
Var text_height = 26 // Title height
Var text_align = 'center' // align the title text (left, center, right)
Var swf_height = focus_height + text_height // The sum of the values is preferably an even number. Otherwise, the number may be blurred.
// When the following three lines of code are added to a program, you can use tags to stack the code.

Var pics = 'images/01.jpg | images/02.jpg | images/03.jpg | images/04.jpg | images/05.jpg'
Var links = '#|##|#| #'
Var texts = 'title of the first image | title of the second image | title of the third image | title of the fourth image | title of the fifth image'

Document. write ('<object classid = "clsid: d27cdb6e-ae6d-11cf-96b8-444553540000" codebase = "http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width = "' + focus_width + '" height = "' + swf_height + '"> ');
Document. write ('<param name = "movie" value = "js/pixviewer.swf"> <param name = "quality" value = "high"> <param name = "bgcolor" value = "# DADADA"> ');
Document. write ('<param name = "menu" value = "false"> <param name = wmode value = "opaque"> ');
Document. write ('<param name = "FlashVars" value = "pics =' + pics + '& links =' + links + '& texts =' + texts + '& borderwidth =' + focus_width + '& borderheight =' + focus_height + '& textheight =' + text_height + '& text_align =' + text_align + '& interval_time =' + interval_time + '"> ');
Document. write ('<embed src = "js/pixviewer.swf" wmode = "opaque" FlashVars = "pics =' + pics + '& links =' + links + '& texts =' + texts + '& borderwidth =' + focus_width + '& borderheight =' + focus_height + '& textheight =' + text_height + '& text_align =' + text_align + '& interval_time =' + interval_time + '"menu =" false "bgcolor =" # ffffff "quality =" high "width ="' + focus_width + '"height ="' + swf_height + '"allowScriptAccess = "sameDomain" type = "application/x-shockwave-flash" pluginspage = "http://www.macromedia.com/go/getflashplayer"/> ');
Document. write ('</object> ');
// -->
</Script>
Many of my friends noticed that it can show news images cyclically in the form of slides. It also has a very beautiful switching effect. clicking on an image will go to the corresponding page, this not only saves valuable page layout, but also makes the Page Dynamic. How can this effect be achieved? Next I will introduce it to you.

Webpage image magic light special effect analysis:

Many of my friends want to develop the "ism" style and directly use the special effect code on their own web pages. However, when viewing source files, they find that these special effects are implemented in Flash, so I gave up. If you carefully analyze the source file, it is not difficult to find that Flash is just a special effect "shell". The actual pictures, links, and text descriptions are actually loaded external variables. After obtaining the Flash file, you only need to modify these variables to implement the webpage image magic light special effect.

Image Magic effects:

Step 1: Download and decompress the demo file. You can see the three files index.htm?pixviewer.swf and pixviewer. fla and several demo images. In this example, You need to modify the webpage file index.htm. pixviewer.swf is a Flash file that implements special effects. pixviewer. fla is the source file of Flash. If you are interested, you can study it.

Step 2: use Dreamweaver or notepad to open the webpage file. The embedded Java Script defines the following variables:

Var focus_width = 250 // Image Width
Var focus_height = 190 // Image Height
Var text_height = 23 // height of the text part
Var swf_height = focus_height + text_height // total height

Var pics0000'1.jpg 2.jpg 3.jpg'
Var links0000'1.jpg 2.jpg 3.jpg'
Var texts = 'Star Bay night view sea sunrise shell museum'

The "pic" variable specifies the image to be loaded, the relative path is used here, if the absolute path is used, it must be changed to the form of "http://www.lihot.cn/other/flash/1.jpg, the path of each image is separated by "", but the number of images cannot exceed six. "links" and "texts" define the link address and name of the image respectively, the modification method is the same as that of the "pic" variable.

Step 3: Set the background color of the text section. Find in the second "document. write ('') "and modify the value of" value.


Now, open index.htm in the browser and you will be able to see the exquisite Flash image magic light effects. Here, the picture not only can be played cyclically, but also the viewer can click the number to directly jump to the corresponding picture, which is very convenient!

 


 

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.