如何从Flash中的aspx页面访问值?

发布于 2024-12-24 17:37:23 字数 596 浏览 3 评论 0原文

海正在尝试访问 aspx 变量。但我不能这样做。我不知道如何解决我的问题。请任何人帮助我。正在使用 flash professional cs5。

import flash.net.URLRequest;
import flash.net.URLVariables;
import flash.net.URLRequestMethod;
import flash.events.Event;
var myRequest:URLRequest = new URLRequest();
var myVariables:URLVariables = new URLVariables();
var myLoader:URLLoader = new URLLoader();
myRequest.url = "http://xxxx";
myRequest.method = URLRequestMethod.POST;
myLoader.addEventListener(Event.COMPLETE, sendComplete);
myLoader.load(myRequest);
function sendComplete(e:Event):void{
trace(myLoader.load(myRequest));  
}

Hai am trying to access the aspx variable.But i can't to do this.I dunno how to Solve my problem.anybody kindly help me.am using flash professional cs5.

import flash.net.URLRequest;
import flash.net.URLVariables;
import flash.net.URLRequestMethod;
import flash.events.Event;
var myRequest:URLRequest = new URLRequest();
var myVariables:URLVariables = new URLVariables();
var myLoader:URLLoader = new URLLoader();
myRequest.url = "http://xxxx";
myRequest.method = URLRequestMethod.POST;
myLoader.addEventListener(Event.COMPLETE, sendComplete);
myLoader.load(myRequest);
function sendComplete(e:Event):void{
trace(myLoader.load(myRequest));  
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

慕烟庭风 2024-12-31 17:37:23

您需要将 ASPX 变量作为隐藏标记写入文档中,然后通过在 ActionScript 中调用 JavaScript 来提取它。检查外部接口

或者,另一种最简单的方法是将 aspx 变量编写为 flash var。 查看此处

或者您可以使用ExternalInterface 来访问查询字符串。检查 Flash ActionScript 抓取查询字符串值

You need to write the ASPX variable in to the document as a hidden tag maybe and then extract it by calling JavaScript inside ActionScript. Check ExternalInterface.

OR, the the other easiest way is to write the aspx variable as a flash var. Check here.

OR you can use the ExternalInterface to access the query string. Check Flash ActionScript Grab Query String Value

野稚 2024-12-31 17:37:23

尝试此代码,URLLoaderDataFormat.TEXT。这将检索文本。

var myTextLoader:URLLoader = new URLLoader();
myTextLoader.load(new URLRequest("http://www.smster.in/ipaddress/Handler.ashx"));
myTextLoader.dataFormat=URLLoaderDataFormat.TEXT;

myTextLoader.addEventListener(Event.COMPLETE, onLoaded);

function onLoaded(e:Event):void {
trace(e.target.data);
}

try this code,URLLoaderDataFormat.TEXT.this will retrieve the text.

var myTextLoader:URLLoader = new URLLoader();
myTextLoader.load(new URLRequest("http://www.smster.in/ipaddress/Handler.ashx"));
myTextLoader.dataFormat=URLLoaderDataFormat.TEXT;

myTextLoader.addEventListener(Event.COMPLETE, onLoaded);

function onLoaded(e:Event):void {
trace(e.target.data);
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文