channel = new AMFChannel('my-amf', 'http://{server.name}:
{server.port}/flex/messagebroker/amf'); in your as file.


--- In flexcoders@yahoogroups.com, "xmwang1982" <[EMAIL PROTECTED]> wrote:
>
> Hi,
> 
> So far as I know all destinations of remote object must be defined 
in
> remote-cofig.xml. 
> 
> Can we do it by programming? If we could set destination properties 
in
> code, it is much more flexible. 
> 
> Anybody knows how to do that?
> 
> Here is my code for dynamic channel setting:
> 
>                         var ro:RemoteObject = new RemoteObject();
>                       
>                       var cs:ChannelSet = new ChannelSet();
>                       var wfc:Channel = new AMFChannel("workflow-
secure-channel",
> "https://localhost:8443/Granite/messagebroker/amfsecure";);
>                       cs.addChannel(wfc);
>                       
>                       ro.channelSet = cs;
>                       ro.destination = "WorkFlowServiceDemo";
>                       
>                       ro.addEventListener(ResultEvent.RESULT, 
onResult);
>                       ro.addEventListener(FaultEvent.FAULT, 
onFault);
>                       
>                       ro.add(v1.text, v2.text);
>


Reply via email to