It solves the problem of garbled characters and compatibility when HTML transmits parameters to Flash at one time.

Source: Internet
Author: User

It solves the problem of garbled characters and compatibility when HTML transmits parameters to Flash at one time.

This afternoon, I want to use HTML to pass two parameters to Flash. I have encountered errors. Here is a summary:

Error 1:

<Param name = "flashvars" value+'&symc=unit1.mp3 & lrcmc = unit1.lrc '/>

The result is 1.3 and 1.

Error 2:

<Param name = "flashvars" value?encodeuricomponent('&symc=unit1.mp3 & lrcmc = unit1.lrc ')/>

The result is the same as the preceding one.


Later, Gao taught the methods supported by both Chinese and English documents, which are recorded here:

Method 1:

Note 1: & amp;

NOTE 2: This method is only available in IE.

<Param name = "flashvars" value+'&amp;symc=unit1.mp3 & amp; lrcmc = unit1.lrc '/>

<Param name = "flashvars" value+'&amp;symc;.mp3 .mp3 .mp3 & amp; lrcmc = Chinese. lrc '/>

NOTE 3: to make it available in FIREFOX. You need to add the code in the embed label in another way.

<Embed flashvars='&amp;symc= .mp3 .mp3 & amp; lrcmc = Chinese... lrc '.../>


The result is:

Unit1.mp3 and unit1.lrc

Chinese and Chinese. lrc


Method 2:

This is common in IE and Firefox.

Http://www.hds8.com/mp3/SimpleMP3Reader.swf? &Symc=unit1.mp3 & lrcmc = unit1.lrc

Http://www.hds8.com/mp3/SimpleMP3Reader.swf? &Symc= .mp3 .mp3 & lrcmc = Chinese. lrc

The result is unit1.mp3 and unit1.lrc.


The result is:

Unit1.mp3 and unit1.lrc

Chinese and Chinese. lrc


In addition, the receiving data program in as3 is written as follows:

Var flashvars: Object = root. loaderInfo. parameters;
Symc_txt.text = flashvars ["symc"];
Export mc_txt.text = flashvars ["lrcmc"];


Zookeeper

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.