This thread may help: http://tech.groups.yahoo.com/group/flexcoders/message/120115
--- In [email protected], "xmwang1982" <[EMAIL PROTECTED]> wrote: > > In my sample, I have to define the following in remoting_config.xml: > > <destination id="WorkFlowServiceDemo" > > <properties> <source>com.test.demo.DemoService</source> > <scope>session</scope> > </properties> > </destination> > > So, whenver you want to add new destination, you have to change this > file and re-deploy the whole project. > > I don't want to change the config file in runtime, but some new > service destinations need to be added. > > Can we set this destination properties for remote object by code? > > Thanks. > > > --- In [email protected], "Cato Paus" <cato1@> wrote: > > > > channel = new AMFChannel('my-amf', 'http://{server.name}: > > {server.port}/flex/messagebroker/amf'); in your as file. > > > > > > --- In [email protected], "xmwang1982" <askycn@> 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); > > > > > >

