Eureka! My first red5 application!

Boo-ya! Finally got this working! My "Hello world" red5 app is attached...It's nothing fancy (adds two numbers together and spits it out in the eclipse debug console), but I couldn't find a good template to work off of that used red5 v.8 and Flex w/ AS3, so here it is.

You'll need Adobe Flex Builder set up in Eclipse to run this.

Installation:
1) Unzip myapp.tar_.gz and place myapp/ in ~/projects/red5/dist/webapps
2) Unzip red5test.tar_.gz and place into your eclipse workspace.
3) make sure to recompile red5 with "ant server"...Read through the log and make sure you don't see any errors.
4) Import the red5test folder into eclipse and debug it as a flex application. If all goes well, you should see that it connected successfully and added 33 + 2 together.

Here are the two important chunks of code (the rest is mostly configuration)

Application.java - the red5 main class

package org.red5.server.webapp.myapp;

import org.red5.server.adapter.ApplicationAdapter;

public class Application extends ApplicationAdapter
{
public double addSomething(double a, double b)
{
log.info("adding " + a + " + " + b);
return a + b;
}
}

red5test.mxml - The flex file with an inline AS3 script to launch a netconnection and connect to red5
NOTE- feel free to weed out the unused imports, I am too lazy.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="connect()">
<mx:Script>
<![CDATA[

  import flash.display.MovieClip;
  import flash.media.Camera;
  import flash.media.Microphone;
  import flash.media.Video;
  import flash.net.NetConnection;
  import flash.net.NetStream;
  import flash.events.NetStatusEvent;
  import flash.events.AsyncErrorEvent;
  import flash.display.SimpleButton;
  import flash.text.*;
  import flash.system.SecurityDomain;
  import flash.system.Security;
  import flash.net.Responder;


private var nc:NetConnection;
private var responder:Responder;

public function connect():void
{
nc = new NetConnection();
  nc.connect("rtmp://localhost/myapp");
    nc.addEventListener(NetStatusEvent.NET_STATUS,net_status_handler);

responder = new Responder(setValue, null);

}

    private function net_status_handler(event:NetStatusEvent):void
     {
      var code:String = event.info.code;
      trace(code);
      if(code== "NetConnection.Connect.Success")
       {
        trace("Success");
        nc.call("addSomething", responder, 2, 33);
       }
      else
       {
        trace("Fault");
        trace(code);
       }
     }
    
     private function setValue(obj:Object):void
     {
     trace(obj.toString());
     }
]]>
</mx:Script>
</mx:Application>

AttachmentSize
myapp.tar_.gz6.15 KB
red5test.tar_.gz252.65 KB

Cheap Jordan Shoes

Welcome to Cheap Jordan Shoes or Cheap Jordans our website, we provied many highly quality but substantial price for every customer. Maybe you can find something at here what you like best. Thanks a lot!

Cheap Jordan Shoes

Every person has his or her opinion. For example, people care much more about their heath. so They would like to buy fitness shoes like Cheap Jordans shoes, Cheap Jordans and you will find some website selling them at discounted price when you click your keyboard to enter Cheap Jordan Shoes or Cheap Jordans our website. Thank you for your coming!

YouTube is a video-sharing

YouTube is a video-sharing website on which users can upload, share, and view video izle. Three former PayPal employees created YouTube in February 2005. In November 2006, YouTube, LLC was bought by Google Inc. for $1.65 billion, and is now operated as a subsidiary of Google. The company is based in San Bruno, California, and uses Adobe Flash Video technology to display a wide variety of user-generated video content, Sevim Emre videoları, Sevim Emre sevişme, Sevim Emre frikikleri, Sevim Emre dekolte, Sevim Emre mini etek, including movie clips, TV clips, and music videos, as well as amateur content such as video blogging and short original videos. Most of the content on YouTube has been uploaded by individuals, although media corporations including CBS, BBC, VEVO and other organizations offer some of their material via the site, as part of the YouTube partnership program.