LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-10-2007, 02:18 PM
babaloui babaloui is offline
Registered User
 
Join Date: Mar 2007
Posts: 1
Rep Power: 0
babaloui is on a distinguished road
Flash to wait for user input outside Flash

Hi,
I found this PHP script, then I made some changes to make it FEED the Flash user interface with online user input.
The main concept of this script is WAITING for user input, so it shows the messages and then go to next line and so on.
The user input go to directly to TEXT file which writes in lines, each line has a unique id = (mag_id).
There "get_msge.php" which works as the middleware between FLASH and messages text file.
The problem, its doesn’t show any data while there are data in the text file.

Help here please, best regards.


AS is:
Code:
// create an object to store the variables
varReceiver = new LoadVars();
// load the variables from the text file
varReceiver.load("get_msg.php?file_id=1&msg_id=1", "POST");
// trigger something - when the variables finish loading 
varReceiver.onLoad = function(){
  //the variables have finished loading
  if (this.msg_id == 1)  {
  _root.xmsg1_swf.text   = this.msg; 
  _root.xmsg1_ch.text    = this.msg;
  gotoAndPlay("line2");   
  } else {WAIT }
}

PHP is:
PHP Code:

[LEFT]<?php
                                    
//get these values from the FLASH
                                    
$file_id_swf   $_POST ['file_id'];
                                    
$file_name     "messages/messages".$file_id_swf.".txt";
                                    
$msg_id_swf    $_POST ['msg_id'];                                                              //_______________________________________________________
                                    //  [0]  ."||".[1] ."||".[2] ."||". [3] ."||".[4]."||". [5].
                                    //$msg_id."||".date."||".time."||".$from."||".$to."||".$msg.
 
                                    
$fp fopen ($file_name'rb');
                                    while (!
feof ($fp))
                                        {
                                    
$msg_txt fgets ($fp1024);
                                    
$line   explode ("||"$msg_txt);
                        
$msg_id $line[0];
                                    
$from   $line[3];
                                    
$to                   $line[4];        
                        
$msg    utf8_encode ($line[5]);                      
                                    
                                    if (
$msg_id == $msg_id_swf)
                                    {
                                                echo 
"msg_id=".$msg_id."&from=".$from."&to=".$to."&msg=".$msg;
                                    } 
 
                                                }
//while
                                    
fclose ($fp);
?>[/LEFT]
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
make flash wait between 2 animation in same MC MarquisDeSade Flash 8 0 04-05-2007 06:55 PM
RESUME: Senior Flash Designer / Developer - San Francisco OSS Work/Job Opportunities 1 08-16-2006 10:01 PM
Talking to a device for Flash input. lariat1997 Flash MX 2004 3 08-30-2005 05:13 AM
+++ Flash Studio PRO v2 +++ Gambini New Softwares 0 03-30-2004 05:24 PM




All times are GMT. The time now is 02:21 AM.