Typed objects p2p through netstream.send()

Can type information be preserved when sending objects using the netstream .send method? I notice when debuggin on the other side that all the objects come through as just that, instances of the object class.
Could you have a custom object instance, say Person, and send that via rtmfp to the other side and preserve the fact that it is a Person?
Sean

Hello. Yes you can preserve the type of the objects when they are sent with NetStream.send(). Just add [RemoteClass] metadata to the class which type you want to preserve.
    [RemoteClass]
    public class NetStreamMessage
          public var id:Number;
          public var data:Object;
          public function NetStreamMessage(data:Object)
               this.data = data;
    var message:NetStreamMessage = new NetStreamMessage("some message");
    publishNetStream.send("handleMessageReceived",message);

Similar Messages

  • NetStream.send not working in Flash Player 11.2 Beta with Cirrus, Please confirm if it is a bug

    Title
    NetStream.send not working in Flash Player 11.2 Beta with Cirrus, Please confirm if it is a bug or feature
    Description
    Problem Description:
    NetStream.send can not send data to peerstreams when using with cirrus. Conflict with documents.
    Sorry for tag the build as 11.0.1.3 while the bug is actually on 11.2 beta since the bug report system didn't have 11.2 beta yet.
    If you are not responsible for 11.2 beta bug fix, please help a hand to handle this bug to 11.2 team.
    This bug is "killing" to your application, so we really appreciate your help. Thanks.
    ==Publisher==
    nc.connect("rtmfp://");
    var ns:NetStream = new NetStream(nc, NetStream.DIRECT_CONNECTIONS);
    ns.publish("sendtest");
    ...//after connection success.
    ns.send("clientfunction", "ok"); // this line cannot reach subscribers. even if subscribers have client object correctly.
    ==Subscriber==
    nc.connect("rtmfp://");
    var ns:NetStream = new NetStream(nc, cirrusid);
    var client:Object = new Object();
    client.clientfunction = clientfunction; // target function
    ns.client = client;
    ns.play("sendtest");
    Steps to Reproduce:
    1. compile the code in the attachment to SendTestExample.swf (not be able to paste it here)
    2. run it under flash player 11.2.202.19 beta
    3. run it under flash player 11
    Actual Result:
    HeartBeat is:
    Start HeartBeat:
    send hello
    send hello
    send hello
    which means NetStream.send was not able to call "clientfunction" as expected.
    Expected Result:
    Start HeartBeat:
    send hello
    in client function: hello
    send hello
    in client function: hello
    send hello
    in client function: hello
    which can call into the clientfunction as flash player 11 did.
    Any Workarounds:
    I can not find it out since it's an api level bug. But this can be very important for lots of applications which rely on send to do rpc.
    Test Configuration
    IE8, Firefox under Windows 7
    Also have problem under Windows XP (but not well tested on this platform)
    App Language(s)
    ALL
    OS Language(s)
    ALL
    Platform(s)
    Windows 7
    Browser(s)
    Internet Explorer 8.0
    ==Attachment==
    package {
        import flash.display.Sprite;
        import flash.events.Event;
        import flash.events.NetStatusEvent;
        import flash.events.TimerEvent;
        import flash.media.Video;
        import flash.net.NetConnection;
        import flash.net.NetStream;
        import flash.text.TextField;
        import flash.utils.Timer;
        import flash.utils.setTimeout;
        public class SendTestExample extends Sprite
            public static var statusArea:TextField;
            var ncServer:NetConnection = new NetConnection();
            var nsServer:NetStream;
            var ncClient:NetConnection = new NetConnection();
            var nsClient:NetStream;
            var timer:Timer = new Timer(1000);
            public function SendTestExample() {
                ncServer.addEventListener("netStatus", onNCStatusServer);
                ncServer.connect("rtmfp://p2p.rtmfp.net","99f72ccbed0948d7589dc38a-3ce1b2616680");
                statusArea = new TextField();
                status("status");
                statusArea.x = 0;
                statusArea.y = 0;
                statusArea.border = true;
                statusArea.width = 200;
                statusArea.height = 350;
                addChild(statusArea);
            function onNCStatusServer(event:NetStatusEvent):void {
                status("Step 1:");
                status("server: " + event.info.code);
                status("id: " + ncServer.nearID);
                switch (event.info.code) {
                    case "NetConnection.Connect.Success":
                        nsServer = new NetStream(ncServer, NetStream.DIRECT_CONNECTIONS);
                        nsServer.addEventListener(NetStatusEvent.NET_STATUS, onNSStatusServer);
                        nsServer.publish("sendtest");
                        ncServer.removeEventListener(NetStatusEvent.NET_STATUS, onNCStatusServer);
                        ncClient.connect("rtmfp://p2p.rtmfp.net","99f72ccbed0948d7589dc38a-3ce1b2616680");
                        ncClient.addEventListener("netStatus", onNCStatusClient);
                    case "NetStream.Publish.BadName":
                        //status("Please check the name of the publishing stream" );
                        break;
            function onNCStatusClient(event:NetStatusEvent):void {
                status("Step 2:");
                status("client: " + event.info.code);
                status("id: " + ncClient.nearID);
                switch (event.info.code) {
                    case "NetConnection.Connect.Success":
                        nsClient = new NetStream(ncClient, ncServer.nearID);
                        var c:Object = new Object();
                        c["clientfunction"] = clientfunction;
                        nsClient.client = c;
                        nsClient.play("sendtest");
                        ncClient.removeEventListener(NetStatusEvent.NET_STATUS, onNCStatusClient);
                        //setTimeout(sendHello, 5000);
                    case "NetStream.Publish.BadName":
                        //status("Please check the name of the publishing stream" );
                        break;
            protected function onNSStatusServer(event:NetStatusEvent):void {
                status("nsserver: " + event.info.code);
                if (event.info.code == "NetStream.Play.Start") {
                    status("Start HeartBeat:");
                    this.timer.addEventListener(TimerEvent.TIMER, function (e:Event):void {
                        sendHello();
                    this.timer.start();
            protected function sendHello():void {
                status("send hello");
                nsServer.send("clientfunction", "hello");
            protected function status(msg:String):void
                statusArea.appendText(msg + "\n");
                trace("ScriptDebug: " + msg);
            protected function clientfunction(event:Object):void {
                status("in client function: " + event);

    Thanks for reporting. I can reproduce the bug in house. We will investigate.
    Calise

  • Optimizing chunks size for filesending with NetStream.send() method

    Hi,
    I would like to implement a p2p filesending application. Unfortunately object replication is not the best solution for this so I need to implement it myself.
    The process is the following:
    Once the user has selected the file for sending, I load it to the memory. After it is completed I cut the file's data into chunks and send these chunks with the NetStream.send() method  - to get the progress of filesending -.
    How can I optimize the size of the chunks for the fastest filesending method or what is the best size for a chunk?

    Hi there
    Please submit a Wish Form to ask for some future version of Captivate to offer such a feature! (Link is in my sig)
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • How to play and stop flv files through NetStream in AIR Application

    Hi,
    In a folder I have 'n' number of flv file, which are DRM protected. when the user try to play those files for the first time through my AIR application, it will prompt for username and password and gets the license/voucher from the server and store it in AIR Runtime. so that from the next time onwords it won't prompt for username and password as because it already has license/voucher.
         My problem is assume there are 500 files, such that for each file the user has to enter his credentials[username and password]. which is a stupid thing. I want to avoid this process by implementing this process internally/programetically. By playing/accessing each file through netstream from the folder and setDRMAuthenticationCredentials for that file and stop the stream. Here I am able to play each file but I am failed to stop it. I mean to say I will get the license for all the flv files internally[while loading my AIR application], such that user should not be interrupted for his credentials for each file.He should play as if he is accessing/playing a non-DRM protected file. I will be very thank full if any one help me out in this.
    public function init():void {
          connectStream();
          getLicenseForAllFiles();
          videoStream.addEventListener(DRMAuthenticateEvent.DRM_AUTHENTICATE, drmAuthenticateEventHandler);
          ppt_videoStream.addEventListener(DRMAuthenticateEvent.DRM_AUTHENTICATE, ppt_drmAuthenticateEventHandler);
            private function getFilesRecursive(rootFolderPath:String):void {
                //the current folder object
                var currentFolder:File = new File(rootFolderPath);
                //the current folder's file listing
                var files:Array = currentFolder.getDirectoryListing();
                //iterate and put files in the result and process the sub folders recursively
                for (var f = 0; f < files.length; f++) {
                    if (files[f].isDirectory) {
                        if (files[f].name !="." && files[f].name !="..") {
                            //it's a directory
                            getFilesRecursive(files[f].nativePath);
                    } else {
                        //it's a file
                        fileList.push(files[f].nativePath);
                        //Alert.show(""+files[0].nativePath);
                        var fileName:String = files[f].name;
                        if(fileName.indexOf("PPT_")!=-1){
                            ppt_videoStream.play(files[f].nativePath);
                            ppt_videoStream.pause();
                        videoStream.play(files[f].nativePath);
                        videoStream.pause();
                private function connectStream():void {
                    videoConnection = new NetConnection();
                    videoConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                    videoConnection.connect(null);
                    ppt_videoConnection = new NetConnection();
                    ppt_videoConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                    ppt_videoConnection.connect(null);
                    videoStream = new NetStream(videoConnection);
                    videoStream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                    video.attachNetStream(videoStream);
                    ppt_videoStream = new NetStream(ppt_videoConnection);
                    ppt_videoStream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                    ppt_video.attachNetStream(ppt_videoStream);
             private function netStatusHandler(event:NetStatusEvent):void {
                switch (event.info.code) {
                    case "NetConnection.Connect.Success":
                        //connectStream();
                        break;
                    case "NetStream.Play.StreamNotFound":
                        trace("Unable to locate video: " + videoURL);
                        break;
                private function drmAuthenticateEventHandler(event:DRMAuthenticateEvent):void {
                    videoStream.setDRMAuthenticationCredentials("adobe", "adobe", "drm");
                private function ppt_drmAuthenticateEventHandler(event:DRMAuthenticateEvent):void {
                    ppt_videoStream.setDRMAuthenticationCredentials("adobe", "adobe", "drm");
    Thanks
    Sudheer Puppala

    Hi,
    Please go through following links..this will help you:
    http://lucamezzalira.com/2009/02/28/create-pdf-in-runtime-with-actionscript-3-alivepdf-zin c-or-air-flex-or-flash/
    http://forums.adobe.com/thread/753959
    http://blog.unthinkmedia.com/2008/09/05/exporting-pdfs-in-flex-using-alivepdf/
    Thanks and Regards,
    Vibhuti Gosavi | [email protected] | www.infocepts.com

  • Netstream.send only text messages or any type?

    In Netstream.send() documentation it says: " ... arguments
    — Optional arguments that can be of any type."
    In the documentation to the Netstream class it says "You can
    also use NetStream objects to send text messages to all subscribed
    clients (see the NetStream.send() method)."
    I tried to send a Rectangle with Netstream.send:
    Code on Sender:
    var rect = new Rectangle(1,2,5,5);
    nc.call("serverShowRect",null, rect);
    Code on Flash Media Server: (FMS 2.0.4)
    STREAM_NAME = "myStream";
    Client.prototype.serverShowRect= function(msg)
    myStream = Stream.get(STREAM_NAME);
    myStream.send("@setDataFrame","onRectangle",msg);
    Code on Client:
    function onRectangle(infoObject:Object):void {
    trace ("Rectangle received.");
    trace ("tracing properties:");
    var key:String;
    for (key in infoObject) {
    trace(key + ": " + infoObject[key]);
    try {
    var rect:Rectangle = infoObject["rectangle"] as Rectangle;
    trace("Rect as rect:" +rect);
    catch (error:Error){
    trace(error.message);
    The function onRectangle() ist called ok. The infoObject's
    properties can be shown by trace. But I cannot convert infoObject
    into an Rectangle. var rect will be either null or I get an
    type-conversion error.
    Does anyone know how to send other data than Strings using
    Netstream.send()? Or can one actually only send Strings using FMS2

    You should receive an email receipt with every purchase that you make in iTunes on the computer or in iTunes, the App Store or the iBookstore on an iOS device. I always get a receipt via email. You are not getting them?
    If you are asking if Apple will send you a detailed purchase history, the answer to that is no since you can access that information in your account in iTunes on your computer. Click on Account under the Quick links on the right side of iTunes, enter your password at the prompt, and then click on "See all" to the right of Purchase History in the next window.

  • Netstream.send() privacy settings

    I'm using Netstream.send() to transfer a file between two users.
    A previous discussion can be found here:
    http://forums.adobe.com/thread/890122?tstart=0
    It works well except of flash settings issue.
    When trying to access a camera or mic the Flash ask the user for permissions automatically.
    When trying to send a file, the Flash player doesn't show the privacy popup.
    If the user doesn't set his privacy to Allow, the file transfer fails.
    There are two issues:
    1. The privacy settings popup isn't shown automatically.
    2. The privacy popup ask permissions to access the camera and mic and doesn't say anything about data transfer.
    Am I missing something or are the above real issues?
    Thanks

    the P2P access dialog will only show when using RTMFP Groups (NetGroup or a group NetStream).  if you're just doing NetStream.send() on a 1-to-1 (NetStream.DIRECT_CONNECTIONS and new NetStream(netConnection, peerID)) P2P connection, then there is no P2P access dialog.
    if you're doing groups and the P2P access dialog isn't showing up, there are a few possible causes:
      1) for some reason you at one point selected "Deny" *and* checked "Remember"; in that case, Flash Player won't present the dialog and will behave as though you clicked "Deny"
      2) Flash Player's window or region in the browser page is too small for the P2P access dialog.  if the P2P access dialog can't be presented because the window is too small, it will behave as though you clicked "Deny"
      3) there is a known bug in Flash Player when using wmode=direct (which you would use for Stage Video) where, when you set wmode=direct, the P2P access dialog won't be displayed, and the behavior will be as though you clicked "Deny".  this issue will be fixed in a future release of Flash Player. to work around this, set wmode to a different value.

  • NetStream.send() with datareliable=false

    Does NetStream.send() and setting NetStream.datareliable = false make the flash player use UDP? Or does it just use TCP for 1 second and then stop?
    Thanks

    the dataReliable flag doesn't control whether you're using TCP or UDP. if you're using RTMP, you're using TCP because that's what RTMP goes over. if you're using RTMFP, you're using UDP because that's what RTMFP goes over.
    if you're using RTMP, the videoReliable, audioReliable, and dataReliable flags have no effect because TCP is fully reliable all the time.
    those flags only have meaning for RTMFP connections. when video/audio/dataReliable is set to true, RTMFP sends the corresponding message with full reliability, retransmitting it if necessary. if a reliable flag is false, RTMFP will not retransmit the corresponding message, and the message will only remain in the transmission queue for 1 second (so depending on network congestion/throughput, the message might not be transmitted at all).
    messages of different types are sent with different priority in RTMFP. audio is highest priority, then NetStream.send() (data), then video. all RTMFP Groups modes (multicast, posting, directed routing, object replication) are lower priority than video.  priority matters when bandwidth is tight.

  • How to create custom attributes & object classes through ldif files in OID

    Hi,
    I have to create 4 attributes and one object class(custom) in OID. I want to creae these attributes and object class through LDIF file.
    I tried creating an attribute through this command
    ldapadd -p 389 -h localhost -D cn=orcladmin -w password -f D:/newattr.ldif
    this ldif file contains inf. for creating a new attributes:
    dn: cn=subschemasubentry
    changetype: add
    add: attributetypes
    attributetypes: ( 1.2.3.4.5.6.10 NAME "xsUserType_new" DESC "User Type Definition" EQUALITY caseIgnoreMatch
    SYNTAX "1.3.6.1.4.1.1466.115.121.1.15" )
    I am getting error: Object class violation
    Failed to find add in mandatory or optional attribute list.
    Please help to find where I am going wrong...
    Thanks.

    Hi Ajay,
    Thank you for the help. Now i am able to create both attributes and object classes in OID through Ldif files.
    I was getting constraint violation error because (I think) I was not giving proper naming convection for attributes and object classes. For OID, there are certain Ldap naming conventions. They are as follows:
    # X below is the enterprise number assigned by IANA
    1.3.6.1.4.1.X.1 - assign to SNMP objects
    1.3.6.1.4.1.X.2 - assign to LDAP objects
    1.3.6.1.4.1.X.2.1 - assign to LDAP syntaxes
    1.3.6.1.4.1.X.2.2 - assign to LDAP matchingrules
    1.3.6.1.4.1.X.2.3 - assign to LDAP attributes
    1.3.6.1.4.1.X.2.4 - assign to LDAP objectclasses
    1.3.6.1.4.1.X.2.5 - assign to LDAP supported features
    1.3.6.1.4.1.X.2.9 - assign to LDAP protocol mechanisms
    1.3.6.1.4.1.X.2.10 - assign to LDAP controls
    1.3.6.1.4.1.X.2.11 - assign to LDAP extended operations
    By using these conventions for attributes and object class, I did got any error and they were created in OID.
    Thanks a zillion.
    Kalpana.

  • Purchase order through External Send to include a CC address

    Does anyone have any idea how to get the e-mail of a purchase order sent through External Send to include a CC address in the e-mail?
    I have searched the forum and found a few questions regarding sending a purchase order to more than 1 e-mail address using external send, but not solutions.
    We have got this working to send to the vendor, but the purchasing manager won't use it until we are able to cc the purchaser into the mail. This is to allow the purchaser to keep track on what has been sent. It seems like an obvious thing to want to do. Is it possible in standard SAP? If not, where should I start to get this to work? Is there a customer exit or another area of code somewhere that I can change to trigger a second e-mail. Alternatively can I run this through workflow somehow?
    Any suggestions will be greatfully received and rewarded.
    Thank you
    Karen

    The vendor e-mail address is picked up from the master data and the purchaser's e-mail would be picked up from their user account. The problem is that I don't know at what stage in the program SAPFM06P, used for sending the purchase order, I could set up the distribution list.
    If I set the vendor address to name.address@somewhere; name2.address@somewhere else this works and both name and name2 receive the e-mail. But it would mean the purchasers ammending the vendor e-mail address each time, which just isn't practical.
    I probably should have said that I'm using SAP version 46c and the e-mail is sent using standard SAP settings for 5-External send using program SAPFM06P and form MEDRUCK.
    Thanks for the advice
    Karen
    Message was edited by: Karen Dean

  • Issue when sending PO through external send

    Hi
    I did the configuration for sending the PO through external send. When I am assigning message type to PO and selecting option as "send immediately' , messge type is not getting assiged.
    Thanks
    Anand

    Hi,
    Check t.code: NACE for application "EF"---->  click Output types
    In next screen,Click your message  type and now check did you have Dispatch time 4 (Send immediately) in "Default values" TAB. If not select Dispatch time 4 (Send immediately) & save.
    Now you can maintain condition record in MN04 with PO message type with all other details like PO document type with Dispatch time 4 (Send immediately)  ..etc..& save.
    Regards,
    Biju K

  • Copy, paste typing object

    Is there any way to copy a "typing" object and paste it
    somewhere else? I'm trying to edit a project and one of my slides
    contains a typing object of a key being pressed. This object
    appears in the timeline but there does not seem to be any way to
    copy it and add it to a different slide. Any advice on how to do
    that?

    Hi gobaldsoon (I'm bald all the time!)
    Unfortunately there is simply no way to edit the typing
    object. Because of this, I find them way too limiting and never use
    them. What you
    can do, however, is to download fellow Adobe Community
    Expert Paul Dewhurst's Typing Text animation from the Captivate
    Exchange. You may visit the Captivate Exchange by
    Clicking
    Here
    Cheers... Rick

  • NetStream.send()

    Hi
    I used NetStream.send("
    Sender ", " parm " ) function to send text .How to define
    the function
    Sender in client file using AS3.

    Sends a message from the server to all subscribing clients is
    the short answer.
    The long, and awesome, answer can be found here:
    http://livedocs.adobe.com/flashmediaserver/3.0/hpdocs/help.html?content=Book_Part_33_cs_as d_1.html

  • [svn] 1142: Add a manual test for BLZ-118 where login through ChannelSet sends an empty destination ID at cluster_request operation .

    Revision: 1142
    Author: [email protected]
    Date: 2008-04-08 08:30:31 -0700 (Tue, 08 Apr 2008)
    Log Message:
    Add a manual test for BLZ-118 where login through ChannelSet sends an empty destination ID at cluster_request operation.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/BLZ-118
    Added Paths:
    blazeds/trunk/qa/apps/qa-manual/clustering/
    blazeds/trunk/qa/apps/qa-manual/clustering/ClusteredChannelSetLoginTest.mxml

    Remember that Arch Arm is a different distribution, but we try to bend the rules and provide limited support for them.  This may or may not be unique to Arch Arm, so you might try asking on their forums as well.

  • ArrayCollection Sort with typed Object

    I have a ArrayCollection that initialize with follwing VO. I need to sort from the 'friendname' attribute.
        public class Friend
            private var _id:Number;
            private var _friendid:Number
            private var _friendname:String
            public function Friend()
            public function get id():Number
                return _id;
            public function set id(value:Number):void
                _id = value                   
            public function get friendid():Number
                return _friendid;
            public function set friendid(value:Number):void
                _friendid = value;
            public function get friendname():String
                return _friendname;
            public function set friendname(value:String):void
                _friendname = value;
    I wrote a function to sort the ArrayCollection
    private function sortDataByFriendName(rawData:ArrayCollection):ArrayCollection
                var dataSortField:SortField = new SortField();
                   dataSortField.name = "friendname";
                    dataSortField.numeric = false;
                    dataSortField.caseInsensitive = true;
                     dataSortField.descending = true;
              var dataSort:Sort = new Sort();
                    dataSort.fields = [dataSortField];
                      rawData.sort = dataSort;
                    rawData.refresh();
                return rawData;
    But the ArrayCollection dosen't sort.
    How do I sort the Sort the ArrayCollections with typed objects
    Thanks in advance.

    Looks right to me.  How did you verify it didn't sort?  Did you get a
    REFRESH event?

  • Can objects returned from web services be cast to strongly typed objects?

    Can objects returned from web services be cast to strongly
    typed objects?
    Last I tried this was with one of the beta of Flex2 and it
    did not work. You had to use ObjectProxy or something like that...
    Thanks

    Please post this question in the CRM On Demand Integration Development forum.

Maybe you are looking for

  • View in Fact Sheet not showing information

    When a user displays an IS-U customer information using transaction code CIC0, only the Business Partner information is populated with details.  The custom view that we created under Fact Sheet doesnt show anything.  Where do you fix this issue?  I c

  • How can PDFs be distilled with narrow margins for optimized viewing on iPad?

    I am not reporting a serious issue. I am seeking to expand my understanding of PDF creating. Using Adobe Acrobat XI version 11.0.10 on MacBook Pro (Retina, Mid 2012, 2.7 GHz Intel Core i7, 16 GB DDR3), I have been creating PDF files of music charts o

  • Can't get internal speakers to work

    I can't get my built in speakers to work. I checked in my sound preferences and optical digital out port is the only thing there. I haven't a clue and thought I'd ask here and see what all you amazingly smart peeps had to say Thanks so much!! and the

  • How to search for data in active directory

    if i have an administrator priviledge, how can i search for user's data if i know his username from active directory.

  • Is it really?

    I am planning on buying an iPod touch in a couple days and im wondering is all of these problems people are having really this serious? Or is it just exaggeration? I don't want my money to be wasted =/