0

我正在尝试在 Flash AS3 中连接到使用 dopostback 方法的页面,但如果有人有任何想法我已经尝试过但没有任何工作,我不知道该怎么做:

import flash.display.Loader;
import flash.net.URLRequest;
import flash.net.URLVariables;

stop()
c3.buttonMode = true

c3.addEventListener(MouseEvent.CLICK,clc)

//******
var web : String = 'https://services.just.edu.jo/courseschedual/index.aspx'
var loader : URLLoader =new URLLoader()
var urlr : URLRequest = new URLRequest(web)
loader.addEventListener(Event.COMPLETE,comp)
var vars : URLVariables 
urlr.method = URLRequestMethod.POST



function clc(e:Event){
    vars = new URLVariables()
    vars.EVENTTARGET = "ctl00$contentPH$facultyDDL"
    vars.EVENTARGUMENT = "80"
    urlr.data = vars
    loader.load(urlr)
}
function comp(e:Event){
    t2.text = (e.target.data)
}
4

1 回答 1

1

你可以使用这样的 POST 变量:

     function clc(e:Event){
        var request:URLRequest = new URLRequest("'https://services.just.edu.jo/courseschedual/index.aspx");
        var variables:URLVariables = new URLVariables();
        variables.EVENTTARGET = "ctl00$contentPH$facultyDDL"
        variables.EVENTARGUMENT = "80"
        request.data = variables;
        request.method = URLRequestMethod.POST;
        var loader:URLLoader = new URLLoader();
        loader.addEventListener(Event.COMPLETE, handleComplete);
        loader.load(request);
    }

    function handleComplete(e:Event):void{
        var loader:URLLoader = URLLoader(event.target);
        var vars:URLVariables = new URLVariables(loader.data);
    }
于 2015-05-21T12:11:32.697 回答