English 中文(简体)
AMF等级分布图
原标题:AMF class mapping not working

我正在利用“灵活”4.5和“天空”作为我的AMF终点进行应用。

我要向“灵活要求”的一类人绘制一个称为“硬墙”的类别。

这是我的实验室:

<?php
namespace appweb;

class CRequest{
   public $_explicitType =  com.site.remote.Request ;

   public $stuff1;

   public $stuff2;

}

这是文稿: com.site.remote。

package com.dreamatique.remoting
{
    [Bindable]
    [RemoteClass(alias="com.site.remote.Request")]
    public class Request
    {

        public var stuff1:String;

        public var stuff2:String;

        public function Request()
        {
        }
    }
}

作为检验标准,我把最终点回归作为<代码>CRequest的一个实例,不管要求是什么。

我当时正在发出这样的呼吁:

var remoteObject:RemoteObject = new RemoteObject();
remoteObject.endpoint = "http://localhost/to/my/amf/endpoint";
remoteObject.showBusyCursor = true;
remoteObject.source =  testing ;
var op:AbstractOperation = remoteObject.getOperation(null);
op.addEventListener(ResultEvent.RESULT, result);
op.send();

public static function result(event:ResultEvent):void{

    trace(event.result);
    trace(Class(getDefinitionByName(getQualifiedClassName(event.result))));
    Alert.show(event.result.toString());

}

问题是结果重新分类为<代码>。 ObjectProxy而不是Request。 我做了什么错误?

最佳回答

确保你在法典文本中至少提及某类。

这是一种常见的陷阱,特别是在首次发出远程电话时,以及在你实际消费任何地方的任何法典中的这种类型之前。

如果未提及该类别,则该类别没有汇编成册,因此没有登记。

通常,在早期发展阶段,我就要最终建立<条码>。 班级:

public class StaticLinks
{
    private var request:Request;
}

随后在我的申请中提到了这一点:

<s:Script>
   var linker:StaticLinks;
</s:Script>

BTW - 你在先前的假设中纠正: 如果您将这一类别作为<代码>[RemoteObject]加以说明,则不必打电话registerClass(

问题回答

你们是否记得注册了这门课?

import flash.net.registerClassAlias;

flash.net.registerClassAlias("com.site.remote.Request", Request);




相关问题
Disable button tooltip in AS3

I want to disable the tooltip on certain buttons. The tooltip manager seems to be an all or nothing solution. Is it possible to disable the tooltip for just one or two buttons?

Multiple Remote call made simultenously

I was making multiple remote calls and they are done sequentially and when I am getting a result event back it s triggering calls to all the methods with ResultEvent as an argument . I am supposed to ...

Attaching a property to an event in Flex/AS3

I have a parameter that needs to be passed along with an event. After unsuccessful attempts to place it on the type by extending the class, I ve been advised in another SO question to write a custom ...

Clearing RSL in Cache

I have built a flex application which has a "main" project and it is assosciated with a few RSL s which are loaded and cached once i run my "main" application. The problem i am facing is that the ...

What s a good way of deserializing data into mock objects?

I m writing a mock backend service for my flex application. Because I will likely need to add/edit/modify the mock data over time, I d prefer not to generate the data in code like this: var mockData =...

AS3 try/catch out of memory

I m loading a few huge images on my flex/as3 app, but I can t manage to catch the error when the flash player runs out of memory. Here is the what I was thinking might work (I use ???? because i dont ...

热门标签