Flash CS4 onPeerConnect does not fire

Hi
I tryed to do Flex example for simple chat (p2p) with Stratus at Flash CS4 IDE
(adapted it of course) but onPeerConnect does not fire.
Can you take a look at my code ?
What's wrong with it ?
package {
    import flash.events.*;
    import flash.net.*;
    import flash.display.*;
    import flash.media.*;
    public class stratusTest2 extends Sprite {
        private const SERVER_ADDRESS:String="rtmfp://stratus.adobe.com/";
        private const DEVELOPER_KEY:String="a9fb14e5b040800e8327ab51-37f33907d0c1/";
        private var nc:NetConnection;
        private var myPeerID:String;
        private var farPeerID:String;
        // streams
        private var sendStream:NetStream;
        private var recvStream:NetStream;
        private var VideoDisplay:MyVideoDisplay;
        private var FAR_PeerVideoDisplay:farPeerVideoDisplay;
        private var VidDisplay:Sprite;
        public function stratusTest2(){
            addEventListener("addedToStage",initThis);
        private function initThis(e:Event){
            VidDisplay=new Sprite();
            addChild(VidDisplay);
            connectToStratusBTN.addEventListener("mouseDown",initConnection);
            initSendStreamBTN.addEventListener("mouseDown",initSendStream);
            initReceiveStreamBTN.addEventListener("mouseDown",initRecvStream);
            sendDataBTN.addEventListener("mouseDown",sendDataBTNPressed);
        private function initConnection(e:MouseEvent){
            if (MY_peerIDText.text) {
                farPeerID=MY_peerIDText.text;
            nc=new NetConnection();
            nc.addEventListener(NetStatusEvent.NET_STATUS,ncStatus);
            nc.connect(SERVER_ADDRESS+DEVELOPER_KEY);
        private function ncStatus(event:NetStatusEvent):void {
            INF.appendText("ncStatus: "+event.info.code+"\n");
            trace(event.info.code);
            myPeerID=nc.nearID;
            MY_peerIDText.text=myPeerID;
        private function initSendStream(e:MouseEvent){
            trace("initSendStream");
            INF.appendText("initSendStream\n");
            sendStream=new NetStream(nc,NetStream.DIRECT_CONNECTIONS);
            sendStream.addEventListener(NetStatusEvent.NET_STATUS,netStatusHandler);
            sendStream.publish("__media");
            var sendStreamClient:Object=new Object();
            sendStream.client=sendStreamClient;
            sendStreamClient.onPeerConnect=function(callerns:NetStream):Boolean{
                farPeerID = callerns.farID;
                trace("onPeerConnect "+farPeerID);
                INF.appendText("onPeerConnect "+farPeerID+"\n");
                return true;
            //VideoDisplay=new MyVideoDisplay(VidDisplay);
            //var camera:Camera=Camera.getCamera();
            //VideoDisplay.attachCamera(camera);
            //sendStream.attachCamera(camera);
        private function initRecvStream(e:MouseEvent){
            recvStream=new NetStream(nc,farPeerID);
            INF.appendText("start receiving from "+farPeerID+"\n");
            recvStream.addEventListener(NetStatusEvent.NET_STATUS,netStatusHandler);
            recvStream.play("__media");
            recvStream.client=this;
            //FAR_PeerVideoDisplay=new farPeerVideoDisplay(VidDisplay);
            //FAR_PeerVideoDisplay.attachStream(recvStream);
        public function receiveSomeData(str:String){
            txtReceiveData.text=str;
        private function sendDataBTNPressed(e:MouseEvent){
            sendStream.send("receiveSomeData",txtSendData.text);
        private function netStatusHandler(event:NetStatusEvent):void {
            trace("netStatusHandler: "+event.info.code);
            INF.appendText("netStatusHandler: "+event.info.code+"\n");
            trace(event.info.code);
i have 3 input texts: MY_peerIDText, txtSendData, txtReceiveData
When i press connectToStratusBTN i get ID after than i open another
browser window with the same swf and paste this ID into MY_peerIDText
After connection i press initSendStreamBTN in first swf (it is 1st browser page)
and i press initReceiveStreamBTN in 2nd swf
After that iwrite down some text in txtSendData TextField (in 1st browser page) and press sendDataBTN
Nothing happens

this function doesn't work correctly:
private function sendDataBTNPressed(e:MouseEvent){
            sendStream.send("receiveSomeData",txtSendData.text);
because you send not String, but link to the txtSendData.text, which is empty in another peer.
So, solution is following (not the one, but for example):
private function sendDataBTNPressed(e:MouseEvent){
         var sendString:String = "";
        sendString+=txtSendData.text;
        sendStream.send("receiveSomeData",sendString);

Similar Messages

  • ON-LOGON does not fire in Form B, called from Form A

    We have a situation like this. We are using Forms (Forms [32 Bit] Version 10.1.2.0.2 (Production)).
    We migrated this application to Forms 11.2.0.1.0. Problem is that the ON-LOGON trigger does not fire in the 2nd level forms. Our application work like this.
    (a.) User double-clicks URL icon.
    (b.) Form A is opened without asking for un/pwd. We put a NULL; in the ON-LOGON of A.fmb.
    (c.) This is the main form of the application. This has a canvas with 6 buttons. Each button will launch it's own separate application with it's own menu.
    (d.) Now user presses button in A. This launches Form B. We use
    Run_Product(FORMS, 'B', SYNCHRONOUS, RUNTIME,FILESYSTEM, pl_id, NULL);              (e.) Now, in Form B, in the ON-LOGON trigger we have put code to show the logon screen and login to the DB.
    Problem is, this works in 10g Forms. But we had to replace the RUN_PRODUCT with a CALL_FORM after migrating to 11g since RUN_PRODUCT is not supported in 11g.
    Problem is that when you use CALL_FORM to call Form B, the ON-LOGON of the Form B does not fire. We tried OPEN_FORM and NEW_FORM with different parameters, but the behavior is the same. i.e. ON-LOGON does not fire.
    What is the solution or workaround for this please.
    Edited by: user12240205 on Oct 15, 2012 4:50 AM
    Edited by: user12240205 on Oct 15, 2012 4:52 AM

    Michael Ferrante (Oracle) wrote:
    If you need to open another form you should use CALL_FORM, OPEN_FORM, or NEW_FORM. In these cases, ON-LOGON will not automatically fire because the connect info is passed from the calling form. If you need to login from the called form then you need to need to programatically cause that to occur. Refer to the LOGON and LOGON_SCREEN built-ins in the Builder help for more info. You can fire these from almost any trigger you like, for example in a WHEN-NEW-FORM-INSTANCE trigger or where ever is appropriate for you application.Michael, we tried using the CALL_FORM, OPEN_FORM & NEW_FORM.
    Also, there is NO connection to the DB, when B is called from A since we don't login to the DB in A (ON-LOGON has NULL;).
    So, if there is no DB connection when B is called, shouldn't the ON-LOGON in B fire?
    We tried firing the LOGON_SCREEN and LOGON in the WHEN-NEW-FORM-INSTANCE. But, for some reason, the we don't get the menu (we get a menu not found error). We tried correcting the paths and other things but still no solution.

  • Flash Player 10 does not work in IE or Firefox. What could it conflict with?

    I'm  using Firefox 3.6.8 (and sometimes IE 8.0.6001.18702IC) on Windows XP Pro, SP 3.
    For some weeks now, I have been unable to hear any sounds on anything Flash-based, from YouTube to games at MSN.com or embedded videos on any site using Flash.  Initially I had assumed it to be because of having QuickTime installed because I know QT likes to hijack everything.  I uninstalled QT (and Real Player) and Flash Player then reinstalled Flash Player (and Shockwave Player just in case) and guess what?
    Yup.  Nothing.  When I uninstalled everything, I used a program called Revo Uninstaller, which includes a registry cleaning option.  I then used Abexo and WinASO's registry cleaners to make sure I got everything else that even looked like QuickTime off my hard drive.
    When I reinstalled Flash, the following programs appeared in C:\Windows\system 32\Macromed\Flash:
    Flash 10i.ocx (10.1.82.76)
    FlashUtil10i_ActiveX (10.1.82.76)
    FlashUntil10i_Plugin (10.1.82.76)
    genuinst (6.0.2800.1531)
    FlashUtil10i_ActiveX.dll (10.1.82.76)
    NPSWF32.dll (10.1.82.76)
    KB931433
    FlashInstall
    Install
    Flashplayer.xpt
    When I check IE's "Tools" and look for add-ons, it says that Flash (Shockwave Flash) is enabled.  I even enabled the other Adobe add-ons for Acrobat and such just to be sure.  Firefox shows Shockwave Flash and Shockwave for Director both to be enabled.  The Flash control panel settings don't help: I have all sites set to store about 100 KB on my computer to make sure there's enough room for everything but still nothing.
    Before anyone asks, my audio drivers are up to date, thanks to the manufacturer's website.  I have DirectX 9.0c installed and everything else works fine.  I can play audio and video elsewhere with no problems.  It's only Flash that's showing me this trouble and there's no hint as to what else could be interfering with Flash.
    Any ideas?

    Well, great.  I tried the uninstall/reinstall before, but not with the uninstaller, so I was hopeful that this time might do it.  No such luck.  The video still plays, but no sound.
    All the sound settings are working with everything else from games to media players.  I set Windows' firewall to allow both the ActiveX and plugin for Flash, just in case.
    In the Flash folder, I now have:
    Flash10l.ocx (10.1.102.64)
    Flash Util10l_ActiveX (10.1.102.64)
    FlashUtil10l_Plugin (10.1.102.64)
    Genuinst (6.0.2800.1531)
    FlashUtil10l_ActiveX.dll (10.1.102.64)
    NPSWF32.dll (10.1.102.64)
    And the setup and text files that went with 'em.
    I've also done a system restart since then and zip.
    I went through IE and Firefox and looked for any file associations (like .flv) that I could manually change over to using Flash, but no go.  The settings panels for Flash have all been set to allow YouTube specifically (as a test) and to allow 10KB of storage space for all affected sites.
    Now what?  I'm really not looking forward to a reformat and reinstall, but it's looking like that's what it's going to take.
    Date: Sun, 14 Nov 2010 17:37:07 -0700
    From: [email protected]
    To: [email protected]
    Subject: Flash Player 10 does not work in IE or Firefox. What could it conflict with?
    Something is strange with your list of modules; you list FlashUntil10i_Plugin (10.1.102.64), but this is really 10.1.85.3
    I recommend that you uninstall Flash Player completely (using http://kb2.adobe.com/cps/141/tn_14157.html), then restart Windows, and delete all remaining files in C:\Windows\system32\Macromed\Flash.
    Next reinstall both ActiveX (http://fpdownload.adobe.com/get/flashplayer/current/install_flash_player_ax.exe) and the plugin (http://fpdownload.adobe.com/get/flashplayer/current/install_flash_player.exe).
    After that, if the problem persists, have a look at this page http://kb2.adobe.com/cps/837/cpsid_83739.html
    >

  • Screen briefly flashes white but does not display the page when the Safari icon or other icons are tapped.

    A problem has just started with my IPAD Air after 3 months of use.
    If I try to open Safari by tapping on the icon the screen  briefly flashes white but does not display the page.
    Similarly if I try to open Settings page, Mail page, Calendar or Clock the screen just briefly flashes but the Apps do not run.
    Some of the Apps do work on tapping the icon e.g. Maps, iBooks, Appstore, iTunes, Newstand etc.
    I do have some website links which display when the icon is tapped e.g. John Lewis but some links do not work.
    I have ensured that the ipad is fully charged,  powered it off an on again, and cleaned the screen with a lint free cloth  but the
    same problem keeps occurring.

    I saume you used a second display at one time, otherwise the Display settings wouldn't be treating your primary display as a secondary.
    IF you open your System Preferences>Displays (-System Preferences) and click "Gather Windows" it should pull everything to the display on which you clicked it.

  • My current Camera Raw 5.7 for Photoshop CS4 Extended does not support Canon EOS 6D. What can I do? Will there be a Photoshop Camera RAW for that?

    My current Camera Raw 5.7 for Photoshop CS4 Extended does not support Canon EOS 6D. What can I do? Will there be a Photoshop Camera RAW for that?

    You would need Camera Raw 7.3 or later to open those files. Adobe is not going to update CS4. You can either get a newer version of Photoshop that comes with a current version of Camera Raw, or you can use the DNG converter to save your files down to the ACR version that works with CS4.

  • Reset does not fire NavigationEvent - is this intended behaviour?

    Hi
    I realized that the ViewObject.reset() method does not fire a NavigationEvent. I think that resetting a current row is some sort of navigation which has some effekt on dependent objects (eg. detail views will be cleared). So I'd have expected that reset() should file a NavigationEvent.
    Can anyone explain me: Is this intended behaviour? Why?
    Thanks
    Frank Brandstetter

    >System Preferences>Mission Control>Show Desktop...should be F11:
    If not, change it.

  • Accordion load event does not fire when accordion and load event created dynamically using actionsript

    I cannot get the accordion load event to fire when I have
    created the accordion and load event using actionscript . Here is
    some sample code:
    createClassObject(mx.containers.Accordion, "acc",
    getNextHighestDepth());
    acc.createSegment(mx.containers.ScrollPane, "sc1", "Number
    One");
    acc.createSegment(mx.containers.ScrollPane, "sc2", "Number
    Two");
    var accLis=new Object();
    accLis.load=function(evtObj) {
    trace("load");
    accLis.change=function(evtObj) {
    trace("change");
    acc.addEventListener("load", accLis);
    acc.addEventListener("change", accLis);
    I made sure to add the ScrollPane and Accordion components
    to my library. So the load event does not fire, but the change
    event does fire. And through further testing the other events do
    not fire, including the draw event. Can anyone help? The only time
    I can get the load event to fire on an accordion is if I put an
    accordion on stage, select it and add the actionscript to the
    objects actions like shown below:
    on(load) {
    trace("load");
    on(draw) {
    trace("draw");
    Can somebody help? Unfortunately I must create all my
    components dynamically. Thank you in advance.

    I'm having this issue also...but only apparently with Internet Explorer and only on some machines...ideas?

  • Flash Player Content does not Minimize when Firefox does

    When Firefox is Minimized, Flash Player Content does not.
    It shows it perfectly with other opened (not minimized) applications in the exact location where it was (the flash content) before. The other application seems to need an RGB colour map of exactly #000000 for it to show.
    It cannot be captured in a screenshot using screengrab, nor can it be shown in playback from recordmydesktop.

    How about the screen saver that kicks in...
    It can even be worse when you also get a red/blue color swap.
    *https://bugbase.adobe.com/index.cfm?event=bug&id=3109467
    Unfortunately Adobe no longer maintains Flash on Linux, so Flash 11.2 is the latest and Adobe has no intention to fix any issues in this version apart from security updates.

  • DidSelectRowAtIndexPath does not fire in SDK 3.0

    Hi everyone!
    I have iPhone application that works well in SDK 2.2.1 But in SDK 3.0 event didSelectRowAtIndexPath (as well as willSelectRowAtIndexPath) in MyTableViewController does not fire.
    I've downloaded "TheElements" sample application and it works fine on 3.0. I figured out that there is a difference in UITableViewCell initialization. So I removed old initWithFrame method and created new one initWithStyle. But no luck. I put breakpoint inside didSelectRowAtIndexPath event but debugger does not stop there.
    What other changes should I make to fire didSelectRowAtIndexPath event?
    Any help will be appreciated.

    romex wrote:
    Removing touchesBegan and touchesEnded methods from custom cell class resolved the problem.
    When we were working on this last June, do you remember if the methods you removed had been passing the events to super? I thought we covered that, but I don't see it anywhere in the thread. In other words, did the methods look like the example below?
    - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    [super touchesBegan:touches withEvent:event]; //<-- pass to UITableViewCell
    // cell does something else here
    Or, was anything like the following tried?:
    - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    [[self superview] touchesBegan:touches withEvent:event]; //<-- pass to super view
    // cell does something else here
    I still think something about the responder chain must have changed in 3.0, but it seems like one or both of the above methods should still work. If neither of them gets the touches where they need to go, maybe nextResponder isn't the same as superview(?). In that case you might try this:
    - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    [[self nextResponder] touchesBegan:touches withEvent:event]; //<-- pass to next responder
    // add extra sanity check
    NSLog(@"superview=%@ nextResponder=%@", [self superview], [self nextResponder]);
    // cell does something else here
    Hope the above sheds more light than confusion!
    - Ray

  • Flash element panel does not appear when Flash is selected in DW3

    In DW3 (Win7) After creating several slide shows using image viewer and months later when I want to edit the image viewer.. When I click on the flash slideshow that I created in image viewer in order to edit it and the Flash Elements panel does not appear on the right as it did before. I have the Tags panel open and it has changed to Flash elements in the past but it is no longer appearing. This happened with a friends DW3 also.

    DW3 or DW CS3?

  • Setter/getter does not fire

    Hi,
    in a class CSampleEntity, the setter function
    public function set title( aValue:String ):void {
    this.setKV( CSampleEntity.PROP_TITLE, aValue );
    does not fire, while setKV() in CSampleEntity's super-class
    defined as
    protected function setKV( key:Object, value:Object ):void {
    _entityData[ key ] = value;
    _dirtyFlag = true;
    and _entityData is defined in CSampleEntity's super-class
    like this:
    // The values of this entity
    private var _entityData:Object = undefined;
    Could someone provide insights, why this call
    var sample:CSampleEntity = new CSampleEntity();
    sample.title = 'Hello World'; // << THIS does not fire
    the setter
    does not fire the 'set title' setter?
    Actually, the Flex AIR debugger show an object of class
    CSampleEntity with a property 'title' - but the setter does not set
    this property!

    "justria" <[email protected]> wrote in
    message
    news:gnkhoe$sk4$[email protected]..
    > Hi,
    >
    > in a class CSampleEntity, which gets instantaiated
    dynamically using
    >
    > public function createEntity( anObjClass:Class
    ):TAAbstractEntity {
    > var obj:TAAbstractEntity = null;
    > obj = new anObjClass();
    > return obj;
    > }
    >
    > the setter function
    >
    > public function set title( aValue:String ):void {
    > this.setKV( CSampleEntity.PROP_TITLE, aValue );
    > }
    >
    > does not fire.
    >
    > Could someone provide insights, why this call
    >
    > var sample:CSampleEntity = stm.createEntity(
    CSampleEntity ) as
    > CSampleEntity;
    > sample.title = 'Hello World'; // << THIS does not
    fire
    >
    > does not fire the 'set title' setter?
    >
    > Actually, the Flex AIR debugger show an object of class
    CSampleEntity with
    > a
    > property 'title' - but the setter does not set this
    property!
    So, if you have
    public function set title( aValue:String ):void {
    trace('aValue');
    You don't see the value traced out?

  • In manage add-ons, it shows Shock wave as enabled but Flash Player still does not work.

    In manage add ons, it shows shock was as enabled, but flash player still does not work

    TryDisabling ActiveX Filtering in Internet Explorer

  • JComboBox does not fire Event

    JCombobox does not fire any event which should be send when typing on the keyboard. (Keypressed, keyReleased, keyTyped, caret-operations)
    Is there a known bug?
    I am using Netbeans 3.6 RC1 with Java 1.4.2_04 under WindowsXP.
    Thanks for your help
    Klaus

    myComboBox.getEditor().getEditorComponent().addKeyListener()

  • Glitch since installing OS X Yosemite. When I download a docx MS Word doc and try to open it the word icon flashes up and does not open.

    Glitch since installing OS X Yosemite. When I download a docx MS Word doc and try to open it the word icon flashes up and does not open.

    Step one is to log into a newly created admin user account and see if the problem persists.
    27" i7 iMac (Mid 2011) refurb, OS X Yo (10.10.1), Mavs, ML & SL, G4 450 MP w/10.5 & 9.2.2

  • MacBook Pro can turn on and off, but does not start up. Stays on white screen with flashing folder icon, does not go to desktop.

    MacBook Pro is not starting up. It just stays on a white screen with a flashing folder icon. Have tried restarting while holding the Option key, and the cursor becomes visible and movable, but it does not go to the desktop.

    Hello Sonya_Rose,
    I found this article when researching the issue you describe here named A flashing question mark appears when you start your Mac found http://support.apple.com/kb/ts1440.
    Check the mouse and keyboard
    This issue might occur if a mouse or trackpad button is pressed during startup. Make sure the button isn't pressed.
    If the issue persists, shut down your Mac with its power button, disconnect any external mouse and keyboard, then turn on your Mac with its power button. If the flashing question mark issue persists, reconnect the keyboard and mouse.
    Additional steps
    If your Mac still starts to a flashing question mark, follow the steps below. If any step resolves the issue, you don't need to continue to the next one.
    Select your Mac OS X startup disk with Startup Manager by restarting and holding the Option key. After your Mac starts up, restart again to verify that the flashing question mark does not appear.
    If the issue persists, insert your Mac OS X installation disc. Be sure to either use the disc that came with your Mac, or, if you installed a later Mac OS X version from disc, use the newer disc.
    MacBook Air note: On a MacBook Air, there are two options for starting up from Mac OS X media: Either connect a MacBook Air SuperDrive to the MacBook Air via the USB port and restart the computer, holding down the C key during startup, or use Remote Install Mac OS X to startup from a system software DVD that's located on a partner computer. Once started up from Mac OS X media, skip to step 3.
    Restart the computer, then hold the C key during startup.
    From the Utilities menu, choose Disk Utility. Don't click Continue.
    Select your Mac OS X disk (named "Macintosh HD" by default) in the left side of the Disk Utility window.
    Click the First Aid tab.
    Click Repair Disk to verify and repair any issues with your Mac OS X startup disk.
    After repairing the disk, try to start up normally.
    Important: If Disk Utility finds issues it cannot repair, you may need to back up as much of your data as possible (or use Time Machine to back up to a different disk), then erase the disk and reinstall Mac OS X. You should back up important files and data before erasing a drive. Erasing deletes everything on the hard disk (including things on your desktop). Also, you can install Mac OS X onto an external disk, start from the external disk, and use Migration Assistant to transfer items from your usual internal Mac OS X startup disk to the external disk, then erase the internal disk and reinstall Mac OS X.
    If the issue persists, and Disk Utility didn't find any irreparable issues, quit Disk Utility, quit the Installer, select your disk when prompted, and restart.
    If the issue continues, reset PRAM. Note: After resetting PRAM, if the computer starts up normally, reselect the startup disk in the Startup Disk preferences.
    If none of these steps resolve the issue, start up from the Mac OS X Installation disc and reinstall Mac OS X.
    Regards,
    Sterling

Maybe you are looking for

  • Time Dimensions and Logical dimension "..that not join to any fact source"

    Hi Guys, I get the following error on the ANSWERS front end: Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14026] Unable to navigate requested

  • Problem with Doctor Who: The Classic Series

    Thank you for taking the time to look at this question. I recently purchased "Doctor Who: Ghost Light" from iTunes, but when I downloaded it, the three episodes were placed in between the first three episodes of "Time and the Rani" on my copy of "The

  • Problem while scheduling job in apex

    Hi All , I have problem while creating job in apex .Let me explain my problem clearly.I have created a page in url: http://apex.oracle.com/pls/otn/ Workspace : PREETHI_WORKSPACE User ID : [email protected] Password : bowova1 Application :Parse and up

  • I can't delete shared photostream folder

    I have several shared photostream folders and have used this feature a lot.  However, one of my folders appears to have a glitch.  I cannot delete from either my computer or iPhone.  I am not sure what caused it.  I am listed as the photostream folde

  • Iphone 4 error 1

    Hey guys. I recently bought an iphone 4 off craigslist for 80 bucks. The seller said when she tried updating to 7.0.4 it would got stuck in recovery mode. I thought it was a good buy cuz i thought i could easily fix it so i bought it. Well i was wron