Hello, thanks for replying; When I alert the author it shows up as the 
current user posting so it exists, and when i use raw.data.from and alert 
it; it shows up as [Object Object].
I am not sure on how my onRaw event should look as it is not intercepting 
any of my custom raw names. such as pipe.request.send('custom_name', 
{'author':author, 'msg':msg});
this.onRaw('custom_name', this.sendMsg); is not picking up the message on 
send unless i change it to onRaw('data');

this is my start function : 


startCore: function () {
        this.core.start({"name":this.options.SN});
        console.log("start");
    },



On Saturday, May 17, 2014 1:52:23 PM UTC-7, michael wrote:
>
> Hello, I am creating a chat and am having problems sending multiple values 
> and receiving them on an onRaw event. I am trying to send the author and 
> the msg to the users but raw.data.author is comming up as undefined while 
> raw.data.msg is defined. when i put this.onRaw('data') it works but 
> this.onRaw('SEND') does not. 
> this is inside the intialize function :
>
>        this.onRaw('data', this.rawSendMsg);
>         this.addEvent('load', this.startCore);// load ape core
>         this.addEvent('ready', this.joinChannel);// once the ape core is 
> loaded connect to pipe/channel
>         this.addEvent('uniPipeCreate', this.channelJoined);
>         this.addEvent('multiPipeCreate', function(pipe) {// once the 
> channel is successfully joined
>             myPipe = pipe;
>             this.channelJoined();
>         });
>
>
> requestMsg: function (pipe, options) {
>                 myPipe.request.send('SEND', {'author':author, 'msg':'<span 
> style="color:#' + SNColorCur + '">' + sn + ': </span>' + ' ' + message});
>     },
>     rawSendMsg: function (raw, pipe) {
>         this.sendMsg(pipe, raw.data.author, raw.data.msg);
>     },
>     parseMessage: function(message){
>         return decodeURIComponent(message);// escape and return raw data 
> for use in sendMsg
>     },
>     sendMsg: function (pipe, from, message) { // function used to send 
> decoded message through rawDataEscape
>         $('.chatBoxmsginCon').append( // once rawDataEscape receives it, 
> the message will be sent to chat
>                     new Element('p', {'author':this.parseMessage(from), 
> 'class':'newMessage', html:this.parseMessage(message)}));
>                     $('.newMessage:last-of-type').hide().fadeIn(300);
>                         $('input[class=Chatmsg]').val("");
>                         this.scrollBot;// scroll chat to bottom for new 
> message
>     }
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/

--- 
You received this message because you are subscribed to the Google Groups "APE 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to