惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - Liki

工作效率 之前之后 如何提高你的工作效率? 提供Gmail与Wallop邀请各两个 MIT_Press_Introduction_To_Algorithms_Second_Edition-Spellbound CSS... 表格动态选择效果 ASP.NET Starter Kit的问题 走出IAESTE CHINA 影响成功与否的两个因素:专注与疯狂 今日计划:修改Plog,为期2天 网页调色之简单易行秘籍 Borland.Together.for.Microsoft.Visual.Studio.NET.v2.0 电子书分享 遇到一个女孩 - Liki 近期的课程 6月过了 想买个二手PDA 问题解决!
Flash Remoting经验不足 - Liki - 博客园
Liki · 2004-12-20 · via 博客园 - Liki

晚上根据AMFPHP Installation Guide上 摆弄AMFPHP(不过这几天该Project在sourceforge上讨论改名的事,所以有条新闻"AMFPHP is dead, INFRNO long life"吓了我一跳,以为那么好个东西突然夭折...),到了写Actionscript代码的时候原代码是如此:

#include "NetServices.as"
#include "NetDebug.as"// ----------------------------
// create the responder object
// In this object we will define
// all the result function for
// the data received from server
// ----------------------------
mainResponder = new Object();
// echoString receiver
mainResponder.echoString_Result = function( data ){
    trace("echoString result")
    trace("received: " + data )
    trace("----")
}
// echoDate receiver
mainResponder.echoDate_Result = function( data ){
    trace("echoDate result");
    trace("received: " + data)
    trace( data instanceof Date )
}
// generic onStauts responder, it will be invoked
// when an error is received from the server
mainResponder.onStatus = function ( data ) {
    trace("an error occurred")
    trace("in line: " + data.line)
    trace("error level: " + data.level)
    trace("description: " + data.description)
}
// define the path of our gateway.php
NetServices.setDefaultGatewayUrl('http://localhost/flashservices/gateway.php');
// initialize a variable for the connection
conn = NetServices.createGatewayConnection();
// initialize the service for our class EchoTest
// an tell which is the responder object
// for all the calls to the server
serv = conn.getService("EchoTest", mainResponder);// now, call the server method 'echoString'
serv.echoString("this is a test");// if you want to call also the echoDate method
// just de-comment the follow line:
// serv.echoDate(new Date());
无论如何都出现"Error opening include file NetServices.as: File not found."和NetDebug.as not found的错误.查了半天google在在这里发现原因,原来这些例子都是面向Flash MX的,而#include在MX2004中是不被推荐的用法(

#include "NetServices.as has been depracated in MX 2004. Try this, import mx.remoting.NetServices;), 虽然没仔细查到错误原因(估计是和路径有关系,因为Classes在$sys$:\Documents and Settings下同样有套备份,如果将这两个文件拷贝到发布目录就会继续报错说这个目录下无法找到NetServices.as中引用的一些文件.)所 以说解决方法是应该使用"import mx.remoting.*;"这样的格式.如此编译成功.

但是问题没有完全解决,首先是把"// serv.echoDate(new Date());"一句注释去掉后没有显示日期,而是报:
"an error occurred
in line: 217
error level: User Error
description: no class named EchoTest is known to the gateway"
问题是EchoTest class完全可以被AMFPHP的gateway.php访问到.
还有一个错误是NetConnection Browser没有出现教程上应该有的显示.空白一片,难道是参数传不进其中?
有待继续考证.