Archive for October, 2007

29
Oct

DATAGRID flash cell renders

Tous les exemples avec un DATAGRID disponibles sur:

http://philflash.inway.fr/example.html

24
Oct

red5 start avec ECLIPSE

1) Allez dans c:\program files\red5\webapps
copier test en demo2

2) garder le dossier source et classes mais effacer leur contenu

3) Ouvrir eclipse:Chosir le workspace:C:\Program Files\Red5\webapps\

4) dans Eclipse: Nouveau projet - demo2

5) Right click source: Build path->use as source folder

6) Bouton droit sur le projet (TOP) demo2->Propritétés

7) Java Build Path->Browse->classes

8) Effacer le dossier inutile Bin

 9) Click droit sur demo2 projet et propriété: Java Build Path->Libraries->Add external JAR->

Red5.jar
commons-logging-1.1.jar

10) demo2->New->Package->demo2

11) demo2 package->New Class->Application

12) ecrire

package demo2;import org.red5.server.adapter.ApplicationAdapter;
public class Application extends ApplicationAdapter { 
   public double add(double a, double b){return a + b; }
}
13) editer les fichiers: red5-web.xml
effacer

Editer
class=”demo2.Application”
singleton=”true” />
14) Editer red5-web.properties
webapp.contextPath=/demo2
14) Editer red5-web.properties15) Editer web.xml
Changer

webAppRootKey /demo2

SOUS FLASH taper:

var nc:NetConnection = new NetConnection();
// connect to the local Red5 server
nc.connect(”rtmp://localhost/demo2″);
nc.onResult = function(obj) {
 trace(”the result is”+obj);
};
nc.onStatus = function(info:Object) {
 trace(info.code);
 trace(info.level);
 trace(info);
 if (info.code == “NetConnection.Connect.Success”) {
  //trace(”susccess”);
 }
};
nc.call(”add”, nc, 2,3);

resultat:5

 

 

18
Oct

Comment verifier qu’un lien pointe bien vers votre site ? BACKLINK check

Comment verifier qu’un lien pointe bien vers votre site ?

Une simple fonction PHP vous permer de le faire !
function check_back_link($remote_url, $your_link) {
    $match_pattern = preg_quote(rtrim($your_link, “/”), “/”);
    $found = false;
    if ($handle = @fopen($remote_url, “r”)) {
        while (!feof($handle)) {
            $part = fread($handle, 1024);
            if (preg_match(“/\”‘]”.$match_pattern.
“(\/?)[\”‘](.*)>(.*)<\/a>/”, $part)) {
                $found = true;
                break;
            }
        }
        fclose($handle);
    }
    return $found;
}
// example:
//if (check_back_link(”http://www.capuccino.com”, “http://www.another.com”)) echo “link exists”;
?>

..,                 = ;                ;                            ;        ;

09
Oct

supprimer erreurs javascript

JAVASCRIPT:
  1. <script language=“javascript”>
  2. var track_errors=1;
  3. function noError()
  4. {
  5.   if (track_errors==1)
  6.      {
  7.         return true;
  8.      }
  9. }
  10. window.onerror = noError;
  11. </script>

03
Oct

Pages HTML avec footer et header fixes

HTML:
  1. <!– Put IE into quirks mode –>
  2. <meta http-equiv=“Content-Type” content=“text/html; charset=UTF-8″ />
  3. <title></title>
  4. <? $hh=100;
  5. $hf=50; ?>
  6.  
  7. <style type=“text/css”>
  8.  
  9. body {
  10.  height:100%;
  11.  max-height:100%;
  12.  overflow:hidden;
  13.  padding:0;
  14.  margin:0;
  15.  border:0;
  16.  }
  17.  
  18. #content {
  19.  display:block;
  20.  overflow:auto;
  21.  position:absolute;
  22.  z-index:3;
  23.  top:<?=$hh;?>px;
  24.  bottom:<?=$hf;?>px;
  25.  width:100%;
  26.  border-left:1px solid #000;
  27.  border-right:1px solid #000;
  28.  }
  29.  
  30. * html #content {
  31.  top:0;
  32.  bottom:0;
  33.  height:100%;
  34.  width:100%;
  35.  border-top:<?=$hh;?>x solid #fff;
  36.  border-bottom:<?=$hf;?>px solid #fff;
  37.  }
  38.  
  39. #head {
  40.  position:absolute;
  41.  top:0;
  42.  width:100%;
  43.  min-width:640px;
  44.  height:<?=$hh;?>px;
  45.  font-size:1em;
  46.  z-index:5;
  47.  border:1px solid #000;
  48.  }
  49.  
  50.  
  51.  
  52. #foot {
  53.  position:absolute;
  54.  bottom:0;
  55.  width:100%;
  56.  min-width:640px;
  57.  height:<?=$hf;?>px;
  58.  z-index:5;
  59.  border:1px solid #000;
  60.  }
  61.  
  62.  
  63.  
  64. </style>
  65. </head>
  66.  
  67. <div id=“head”>hello world</div>
  68. <div id=“foot”>THIS IS FOOTER</div>
  69. <div id=“content”>
  70. A layout with a fixed width, a fixed header and a fixed footer that stays on the bottom. The content area fits between the header and footer and scrolls if necessary. Plus the bonus of a CSS navigation menu that works in all browsers.

01
Oct

red5 link

http://sunil-gupta.blogspot.com/search/label/Red5

01
Oct

RED5 client info

Comment creer un client avec paramètres (role, id, username) sous red5 ?

 

Creer un objet client

public class Client{
String clientId = null;
String clienName = null;
String clientRole = null;

public String getRole(){
return clientRole;
}
public String getName(){
return clientName;
}
public String getId(){
return clientId;
}
public void setRole(String role){
clientRole = role;
}
public void setName(String name){
clientName = name;
}
public void setId(String id){
clientId = id;
}
}

(…)

public boolean roomConnect(IConnection iconnection, Object params[]){
if(!super.roomConnect(iconnection, params)){
log.info((new StringBuilder()).append(”Application failed to connect room: “).append(iconnection.getScope().getName()).toString());
return false;
}
else{
log.info((new StringBuilder()).append(”Application room connect initiated for room “).append(iconnection.getScope().getName()).append(”: “).toString());

//AJouter les infos du client ici
Client client = new Client();
client.setId(params[0].toString());
client.setName(params[1].toString());
client.setRole(params[2].toString());
iconnection.getClient().setAttribute(”client”, client);

return true
}
}

public boolean roomJoin(IClient iclient, IScope iscope){

/*ICI on accede aux infos de notre client !*/

Client client = ((Client)iclient.getAttribute(”client”));
String clientName = client.getName();
String clientId = client.getId();
String clientRole = client.getRole();

return true;
}

01
Oct

red5 search engine

les maiing peuvent etre cherchés :

http://www.nabble.com/Red5-f16328.html