A little trick to play code on a Web page flash

Source: Internet
Author: User
Flash Play | tips | Web page

A little trick to play code on a Web page flash

A lot of web pages are inserted flash playback code, this is not only for the diversity of page elements, but also to reflect the needs of the content. Most of the time, we have the problem of using Flash script to read different audio sources or video feeds as needed, so how do we achieve this? Here we use the rewrite <object> tag code to implement.

A typical flash player source code often has such a statement:
<param name= "movie" value= "http://mydomin/example.swf"/>
Here we can modify the value to Value= "Http://mydomin/example.swf?videoSource=http://mydomin/video/songs/1.mp3"
This means that example.swf will call Http://mydomin/video/songs/1.mp3 such an audio source (or, of course, video). In this way, your flash can get the VideoSource variable value _root.videosource= "Http://mydomin/video/songs/1.mp3" in _root.
Here is an example:


After using DW to insert a SWF with the name MEDIAFLA, add the parameter "? Sourceurl=music1.mp3" after the SWF path, as follows:

<object classid= "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase= "http://download.macromedia.com/pub/ shockwave/cabs/flash/swflash.cab#version=7,0,19,0 "width=" height= ">"
<param name= "movie" value= "Mediafla.swf?sourceurl=http://mydomin/music1.mp3"/>
<param name= "Quality" value= "High"/>
<embed src= "One" quality= "High" pluginspage= "Http://www.macromedia.com/go/getflashplayer" type= "application/" X-shockwave-flash "width=" height= "></embed>"
</object>

In this way, when you make flash, you can use the _root.sourceurl in the script to get the variable value "Http://mydomin/music1.mp3" to read the audio source.



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.