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

推荐订阅源

K
Kaspersky official blog
T
Threat Research - Cisco Blogs
N
News and Events Feed by Topic
Hacker News: Ask HN
Hacker News: Ask HN
Project Zero
Project Zero
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - 叶小钗
Security Latest
Security Latest
Spread Privacy
Spread Privacy
aimingoo的专栏
aimingoo的专栏
N
News and Events Feed by Topic
Webroot Blog
Webroot Blog
U
Unit 42
Cyberwarzone
Cyberwarzone
小众软件
小众软件
Scott Helme
Scott Helme
Engineering at Meta
Engineering at Meta
Microsoft Security Blog
Microsoft Security Blog
T
The Blog of Author Tim Ferriss
A
About on SuperTechFans
爱范儿
爱范儿
S
Schneier on Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Schneier on Security
Schneier on Security
Latest news
Latest news
GbyAI
GbyAI
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
The Register - Security
The Register - Security
WordPress大学
WordPress大学
博客园_首页
Blog — PlanetScale
Blog — PlanetScale
PCI Perspectives
PCI Perspectives
Jina AI
Jina AI
AI
AI
NISL@THU
NISL@THU
I
Intezer
G
GRAHAM CLULEY
B
Blog
S
Secure Thoughts
IT之家
IT之家
宝玉的分享
宝玉的分享
Recent Announcements
Recent Announcements
Y
Y Combinator Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
酷 壳 – CoolShell
酷 壳 – CoolShell
有赞技术团队
有赞技术团队
V2EX - 技术
V2EX - 技术
Recorded Future
Recorded Future
Hacker News - Newest:
Hacker News - Newest: "LLM"

博客园 - 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没有出现教程上应该有的显示.空白一片,难道是参数传不进其中?
有待继续考证.