如何获得/获得在Flash AS3从URL变量 [英] How to get/obtain Variables from URL in Flash AS3
本文介绍了如何获得/获得在Flash AS3从URL变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所以,我有我需要我的Flash影片从提取变量网址:
So I have a URL that I need my Flash movie to extract variables from:
例如链接:
<一href="http://www.example.com/example_xml.php?aID=1234&bID=5678">http://www.example.com/example_xml.php?aID=1234&bID=5678
我需要得到援助和投标数量。
I need to get the aID and the bID numbers.
我能够得到完整的URL转换为字符串通过ExternalInterface的
I'm able to get the full URL into a String via ExternalInterface
var url:String = ExternalInterface.call("window.location.href.toString");
if (url) testField.text = url;
只是不确定如何操作字符串只得到了1234和5678号。
Just unsure as how to manipulate the String to just get the 1234 and 5678 numbers.
鸭preciate任何提示,链接或这方面的帮助!
Appreciate any tips, links or help with this!
推荐答案
创建了一个新的实例的URLVariables
。
// given search: aID=1234&bID=5678
var search:String = ExternalInterface.call("window.location.search");
var vars:URLVariables = new URLVariables(search);
trace(vars.aID); // 1234
trace(vars.bID); // 5678
这篇关于如何获得/获得在Flash AS3从URL变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文