开发者

How to insert complex strings into Actionscript?

How to insert complex strings into Actionscript?

So I have a string

    -vvv -I rc w:// v dv s="60x40" --ut="#scode{vcode=FV1,acode=p3,ab=128,ch=2,rate=4400}:dup{dt=st{ac=http{mime=v/x-flv},mux=mpeg{v},dt=:80/sm.fv}}"

How to insert it into code like

public var SuperPuperComplexString:String = new String();
SuperPuperComplexString =  TO_THAT_COMPLEX_STRING;

That string has so many problems like some cart of it can happen to be like regexp BUTI DO NOT want it to be parsed as any kind of reg exp - 开发者_开发百科I need It AS IT IS!)

How to put that strange string into variable (put it not inputing it thru UI - hardcode it into AS code)?


SInce the only problem characters in your string are the double quotes ( " " ), just enclose your String in single quotes ( ' ' ). That will solve any problems.

It also depends on how you are loading that string into your code, as well.

You could even go so far as to encase that String in XML CDATA to ensure it's all delimited for when you want to use it.

var myString:XML = new XML();
myString = "<string><![CDATA[-vvv -I rc w:// v dv s="60x40" --ut="#scode{vcode=FV1,acode=p3,ab=128,ch=2,rate=4400}:dup{dt=st{ac=http{mime=v/x-flv},mux=mpeg{v},dt=:80/sm.fv}}"]]></string>"

Then, you can access it as a string from anywhere by just referencing myString.


var myString:String = '-vvv -I rc w:// v dv s="60x40" --ut="#scode{vcode=FV1,acode=p3,ab=128,ch=2,rate=4400}:dup{dt=st{ac=http{mime=v/x-flv},mux=mpeg{v},dt=:80/sm.fv}}"'

Not sure where your problem is..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜