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

推荐订阅源

雷峰网
雷峰网
D
Darknet – Hacking Tools, Hacker News & Cyber Security
P
Proofpoint News Feed
Spread Privacy
Spread Privacy
C
Cisco Blogs
L
Lohrmann on Cybersecurity
宝玉的分享
宝玉的分享
I
Intezer
aimingoo的专栏
aimingoo的专栏
Cisco Talos Blog
Cisco Talos Blog
The Register - Security
The Register - Security
GbyAI
GbyAI
C
CERT Recently Published Vulnerability Notes
Apple Machine Learning Research
Apple Machine Learning Research
U
Unit 42
Cyberwarzone
Cyberwarzone
爱范儿
爱范儿
I
InfoQ
博客园_首页
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
量子位
P
Palo Alto Networks Blog
Microsoft Azure Blog
Microsoft Azure Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
有赞技术团队
有赞技术团队
T
Tailwind CSS Blog
腾讯CDC
阮一峰的网络日志
阮一峰的网络日志
NISL@THU
NISL@THU
T
Threatpost
T
The Blog of Author Tim Ferriss
云风的 BLOG
云风的 BLOG
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
Schneier on Security
Security Latest
Security Latest
Martin Fowler
Martin Fowler
H
Help Net Security
小众软件
小众软件
The Hacker News
The Hacker News
Know Your Adversary
Know Your Adversary
博客园 - 司徒正美
人人都是产品经理
人人都是产品经理
T
The Exploit Database - CXSecurity.com
Jina AI
Jina AI
Engineering at Meta
Engineering at Meta
The GitHub Blog
The GitHub Blog
P
Proofpoint News Feed
IT之家
IT之家
WordPress大学
WordPress大学
S
Securelist

博客园 - 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 电子书分享 遇到一个女孩 近期的课程 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没有出现教程上应该有的显示.空白一片,难道是参数传不进其中?
有待继续考证.