Visualizzazione dei risultati da 1 a 6 su 6
  1. #1

    Passaggio variabile da file php a flash

    Ciao a tutti.
    Ho un problema col passaggio di una variabile da php a flash 8.
    Nel file php leggo da DB MYSQL dei dati e li salvo tutti all'interno di una variabile che chiamo "testo".
    Una volta eseguita la query e salvato il contenuto nella variabile "testo" faccio l'echo in maniera tale che flash legga il suo contenuto.
    Sapendo che la variabile contiene delle ancor del tipo: "<a href=view.php?id=2&us=4&lan=it>cliccaqui</a>", vorrei sapere come si può fare per far leggere a flash questa variabile in maniera corretta.
    Di seguito riporto il codice php e poi quello flash.
    PHP:
    codice:
    <embed src=fileflash.swf width=289 wmode="transparent"> 
     <? $testo = "";
     $i=1;
    while ($row = mysql_fetch_array($UltimiReportage))
    { 
     $DirReportage = $row["nome"];
     $cod = $row["cod"];
     $testo .= "&testo$i=<a class=\"linkrep\" target=\"_top\" href=\"visual_rep.php?DirReportage=".$DirReportage."&cod=".$cod."\">";
       $i++;
       $paeseingl = Maiuscolo($row["paeseingl"]);
       $testo .= $paeseingl." - ".$row["nomeingl"];
       $testo .= "</a>
    ";
    } 
    $testo=urlencode($testo);
    echo $testo." &";?>
    FLASH:
    codice:
    stop();
    System.useCodepage = true;
    Stage.showMenu = false;
    Stage.scaleMode = 'noScale';
    var caricadati = new LoadVars();
    caricadati.onLoad = function(success) {
    	if (success) {
    		// se il caricamento avviene con successo
    		// carica nella casella testo il contenuto di testo
    		trace("caricato");
    		if (this.ok) {
    			j = 1;
    			_root.testo.htmlText = "";
    			while (this["testo"+j] != undefined) {
    				_root.testo.htmlText += this["testo"+j];
    				j++;
    			}
    			_root.output.text = "ok";
    		} else {
    			_root.testo.htmlText = "";
    			_root.output.text = "error";
    		}
    	} else {
    		// se il caricamento non avviene con successo
    		trace("non ho caricato");
    	}
    };
    caricadati.load("filephp.php");
    fscommand("allowscale", false);
    
    su_btn.onPress = function(){
    	_root.onEnterFrame = function(){
    		caricadati.scroll--;
    	}
    };
    su_btn.onRelease = function(){
    	_root.onEnterFrame = undefined;
    }
    giu_btn.onPress = function(){
    	_root.onEnterFrame = function(){
    		caricadati.scroll++;
    	}
    };
    giu_btn.onRelease = function(){
    	_root.onEnterFrame = undefined;
    }
    
    t = new Object()
    t.onKeyDown = function(){
    	if(Key.isDown(Key.UP)){
    		caricadati.scroll--;
    	}else if(Key.isDown(Key.DOWN)){
    		caricadati.scroll++;
    	}
    };
    Key.addListener(t);
    Qualcuno sa dirmi come posso fare per vedere il testo in un frame flash??
    Grazie

  2. #2
    COACH chiedo il tuo aiutooooooooooooooooooo.

  3. #3
    c'è qualcuno??? VVoVe:

  4. #4
    Ho scritto in un altro forum ed il problema è stato quasi risolto...
    Adesso flash mi legge il file che gli passo da php però mi scrive il contenuto pari pari senza interpretarmi i tag html.
    Come posso fare per far sì che flash interpreti i tag html contenuti nella variabile passata da php?
    Grazie

  5. #5
    Posto comunque il codice modificato:
    PHP:
    Codice PHP:
    <embed src=fileflash.swf width=289 wmode="transparent"></embed> 
    <?php  $testo "";
     
    $i=1;
    while (
    $row mysql_fetch_array($UltimiReportage))

     
    $testox .= "&testo$i=";
     
    $testotemp "<a class=\"linkrep\" target=\"_top\" href=\"visual_rep.php?DirReportage=".$DirReportage."&cod=".$cod."\">";
       
    $i++;
     ....
     
    $testotemp "</a>
    &"
    ;
     
    $testotemp urlencode($testotemp);
     
    $testox .= $testotemp;

    $testo $testox;
    echo 
    $testo;?>
    FLASH:
    codice:
    stop();
    System.useCodepage = true;
    Stage.showMenu = false;
    //Stage.scaleMode = 'noScale';
    var caricadati = new LoadVars();
    caricadati.onLoad = function(success) {
    	if (success) {
    		// se il caricamento avviene con successo
    		// carica nella casella testo il contenuto di testo
    		trace("caricato");
    			j = 1;
    			_root.testo.htmlText = "";
    			while (this["testo"+j] != undefined) {
    				_root.testo.htmlText += this["testo"+j];
    				j++;
    			}
    	} else {
    		// se il caricamento non avviene con successo
    		trace("non ho caricato");
    	}
    };
    caricadati.load("frameultimireportage3.php",this);
    fscommand("allowscale", false);
    
    su_btn.onPress = function(){
    	_root.onEnterFrame = function(){
    		_root.testo.scroll--;
    	}
    };
    su_btn.onRelease = function(){
    	_root.onEnterFrame = undefined;
    }
    giu_btn.onPress = function(){
    	_root.onEnterFrame = function(){
    		_root.testo.scroll++;
    	}
    };
    giu_btn.onRelease = function(){
    	_root.onEnterFrame = undefined;
    }
    
    t = new Object()
    t.onKeyDown = function(){
    	if(Key.isDown(Key.UP)){
    		_root.testo.scroll--;
    	}else if(Key.isDown(Key.DOWN)){
    		_root.testo.scroll++;
    	}
    };
    Key.addListener(t);

  6. #6
    Penso comunque che a qualcuno questo thread possa sicuramente servire...
    Rimango in attesa di una vostra soluzione al problema dell'interpretazione dei tag html da parte di flash.
    Ciao

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.