Comunidad de diseño web y desarrollo en internet online

texto dinamico php mysql en flash

Citar            
MensajeEscrito el 18 Jul 2010 06:08 pm
Hola amigos, estuve 2 dias luchando modificando el guestbook que saque de una pagina muy conocida, logre editar el mensaje que el usuario dejo y ahora...
tengo la siguiente estructura el la db
nombre
email
empresa
comentarios
lo que necesito es en flash, 4 textos dinamicos con su respectiva variable y que flash recoja del php y muestre en nombre email empresa...
Porque lo que tengo es en lectura de todo junto en un TextArea

alguien me puede ayudar

Código PHP :

<?
// Connect to mySQL Server 
   $DBConn = mysql_connect($DBhost,$DBuser,$DBpass) or die("Error in GuestBook Application: " . mysql_error()); 
   // Select mySQL Database 
   mysql_select_db($DBName, $DBConn) or die("Error in GuestBook Application: " . mysql_error()); 

// Part Two - Choose what action to perform 
   $action = $_GET['action']; 
    
   switch($action) { 
      case 'read' : 
         // Fetch all comments from database table 
         $sql = 'SELECT * FROM `' . $table . '`'; 
         $allComments = mysql_query($sql, $DBConn) or die("Error in GuestBook Application: " . mysql_error()); 
         $numallComments = mysql_num_rows($allComments); 
         // Fetch page-wise comments from database table 
         $sql .= ' ORDER BY `time` DESC LIMIT ' . $_GET['NumLow'] . ', ' . $numComments; 
         $fewComments = mysql_query($sql, $DBConn) or die("Error in GuestBook Application: " . mysql_error()); 
         $numfewComments = mysql_num_rows($fewComments); 
         // Generate Output for Flash to Read 
         print '&totalEntries=' . $numallComments . '&'; 
         print "<br>&entries=";     
          
         if($numallComments == 0) { 
            print "No entries in the guestbook, as yet.."; 
         } else {  
            while ($array = mysql_fetch_array($fewComments)) { 
               $name = mysql_result($fewComments, $i, 'name'); 
               $email = mysql_result($fewComments, $i, 'email'); 
               $empresa = mysql_result($fewComments, $i, 'empresa'); 
               $comments = mysql_result($fewComments, $i, 'comments'); 
               $time = mysql_result($fewComments, $i, 'time'); 
                
               print '<b>Name: </b>' . $name . '<br><b>Email: </b>' . $email . '<br><b>Empresa: </b>' . $empresa . '<br><i>Comments: </b>' . $comments . '<br><i>Date: ' . $time . '</i><br><br>'; 
               $i++; 
            } 
        } 
        // Print this only when there aren't any more entries.. 
        if($_GET['NumLow'] > $numallComments) { 
           print 'No More Entries!&'; 
        } 
        break; 
   } 
?>  


Código ActionScript :

function loadEntries(act, increment) {
   // Define NumLow as a Number
   num = new Number(_parent.NumLow);
   // Act accordingly
   if(act == "Next") {
      // Add increment
      _parent.NumLow = num + increment;
   } else if(act == "Previous") {
      _parent.NumLow = num - increment;
   } else {
      // Load default - i.e. 0
      _parent.NumLow = 0;
   }
   // Update Statistics
      _parent.read.low.text = _parent.NumLow;
      _parent.read.high.text = Number(_parent.NumLow) + 10;
   // Show Please wait text
   _parent.read.entries.text = "Loading entries... Please wait...";
   // Begin Loading
   myEntries = new LoadVars()
   myEntries.ref = this
   myEntries.load("Gues.php?action=read&r="+random(999)+"&NumLow="+_parent.NumLow) 
   myEntries.onLoad = function(success){ 
      if(success){ 
         // Assign output to components and objects
         entries.text = this.entries;
         totalEntries.text = this.totalEntries;
         //Update values to calculate prev/next button visibility
         num = Number(_parent.NumLow)
         var totalEntries = Number(this.totalEntries); 
         var total = num+increment
         //Hide/show next button
         if(total<totalEntries) this.ref.next_button._visible = true;
         else this.ref.next_button._visible = false
         //Hide/show previous button
         if(num==0) prev_button._visible = false; else prev_button._visible = true
      }
   } 
}
// Load Default
_parent.read.loadEntries("Default", 10);
stop();

Por marmol

15 de clabLevel



Genero:Masculino  

Fabricante de Maquinas industriales

msie8
Citar            
MensajeEscrito el 19 Jul 2010 03:04 pm

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 20 Jul 2010 08:36 pm
Gracias por la respuesta se ve que no es tan facil como esperaba.. jeje pero manos a la obra me voy a poner a leer el ejemplo que mandaste gracias

Por marmol

15 de clabLevel



Genero:Masculino  

Fabricante de Maquinas industriales

msie

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.