dsfds2343 2015-07-08 12:57
浏览 65

在setinterval循环中尝试加载变量后,php块as3

php bloack as3 after trying load variables in setinterval loop. i guess the title explain it all. actually i have flash widget that use URLLoader to grab some php variables and it works perfect but this urlloader is in setinterval loop that happens every 2 mins the problem is it work for several times well then after that php blocks the ip that loading the variables (using flash widget) and gives no response. i tried to search about this subject but found nothing especially that flash is outdated but i am using this flash in place which dont support except flash no js... idk what is the problem exactly but i got huge feeling its a server side issue and idk how to fix it. thought to share my issue here maybe someone can help. btw it blocks the ip of the user that been using the flash for long not for all but after 2-3 mins it unblocks the ip again and works again

btw when my ip is blocked by php i get this error as return by flash:

2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.

and by searching up found that this means the flash got nothing back from php request.

the as3 code is as simple as that:

submit_btn.addEventListener(MouseEvent.CLICK, btnDown);

function btnDown(event:MouseEvent):void {               

var variables:URLVariables = new URLVariables();

var varto:URLRequest = new URLRequest("http://url/dir/script.php");
varto.method = URLRequestMethod.POST;
varto.data = variables;
var varLoader:URLLoader = new URLLoader;
varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
varLoader.addEventListener(Event.COMPLETE, completeHandler);
variables.somecode = "code";    
varLoader.load(varto);  
function completeHandler(event:Event):void{
var Var1fromphp = event.target.data.var1ofphp;
var Var2fromphp = event.target.data.var2ofphp;
from1_txt.text = Var1fromphp;
from2_txt.text = Var2fromphp;
trace("traced:" + event.target.data);

}   

    }

thanks and appreciate all the replies/support

  • 写回答

1条回答 默认 最新

  • doubaoxue5788 2015-07-08 14:42
    关注

    found the problem wasnt php/server side its all about encoding then decoding the url for the variables cuz some vars had "&" character which interfer with the reponse.

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大