+ Reply to Thread
Results 1 to 4 of 4

Estrarre coordinate.... ...XML

This is a discussion on Estrarre coordinate.... ...XML within the Flash CS3 | PHP | mySQL forums, part of the Flash Italiano category; Ciao a tutti e stracomplimenti x il forum!!! Fantastico!!! Ho postato la stessa cosa in Actionscript 3.0, ma credo che ...

  1. #1
    Junior Member Settled In seal is on a distinguished road
    Join Date
    Mar 2008
    Posts
    28
    Rep Power
    0

    Estrarre coordinate.... ...XML

    Ciao a tutti e stracomplimenti x il forum!!!
    Fantastico!!!

    Ho postato la stessa cosa in Actionscript 3.0, ma credo che qui sia + adatto!!!

    Ma veniamo al mio problema...

    Ho uno spazio (stage) nel quale l'utente ha la possibilità di spostare e ruotare degli oggetti (movieclip).
    è possibile riuscire a estrarre sotto forma di valori numerici questi dati (posizione in x,y e rotazione) in un file xml al salvataggio da parte dell'utente della sua "creazione" in modo da poter riutilizzare poi quei dati???

    Spero di essere stato chiaro... se servono chiarimenti ditemi pure!!!

  2. #2
    tem
    tem is offline
    Moderator Moving My Stuff To The FlepStudio tem is on a distinguished road tem's Avatar
    Join Date
    Jan 1970
    Posts
    753
    Rep Power
    44

    Re: Estrarre coordinate.... ...XML

    Ciao!
    io farei così:
    un tasto "salva" che quando premuto invia ad un file php le posizioni che ti interessano degli oggetti..
    il file php scrive in un file xml le posizioni.

    se però vuoi dare la possibilità a + utenti di "recuperare" le posizioni degli oggetti.. dovresti strutturare il tutto su un Db..

    per l'invio dati a Php puoi usare un metodo di questo tipo:

    Code:
    		private function inviaDati():void
    		{
    			var variables:URLVariables=new URLVariables();
    			variables.nomeZero=my_clip.x;
    			variables.nomeUno=my_clip.y;
    			variables.nomeDue=my_clip.rotation;
    			var richiesta:URLRequest=new URLRequest();
    			//cambia l'url del file php in base a dove lo metti  :))
    			richiesta.url='http://www.miosito.com/mioFile.php';
    			richiesta.method=URLRequestMethod.POST;
    			richiesta.data=variables;
    			var loader:URLLoader=new URLLoader();
    			loader.dataFormat=URLLoaderDataFormat.VARIABLES;
    			addListeners(loader);
    			try 
    			{
    				loader.load(richiesta);
    			} 
    			catch (error:Error) 
    			{
    				trace('Unable to load requested document.');
    			}
    		}
    		
    		private function addListeners(d:IEventDispatcher):void
    		{
    			d.addEventListener(Event.OPEN,inizio);
    			d.addEventListener(ProgressEvent.PROGRESS,inProgresso);
    			d.addEventListener(Event.COMPLETE,completato);
    			d.addEventListener(SecurityErrorEvent.SECURITY_ERROR,securityError);
    			d.addEventListener(HTTPStatusEvent.HTTP_STATUS,httpStatus);
    			d.addEventListener(IOErrorEvent.IO_ERROR,ioError);
    		}
    		
    		private function inizio(e:Event):void 
    		{
    			debug_txt.text='Invio messaggio in corso...';
    		}
    		
    		private function inProgresso(e:ProgressEvent):void 
    		{
    			debug_txt.text='Invio messaggio in corso...';
    		}
    		//se il php invia un echo "answer=ok";
    		private function completato(e:Event):void
    		{
    			var loader:URLLoader=URLLoader(e.target);
    			var vars:URLVariables=new URLVariables(loader.data);
    			if(vars.answer=='ok')
    				debug_txt.text='Dati salvati';
    			else
    				debug_txt.text='Errore di sistema, ripova per favore';
    			
    		}

  3. #3
    Junior Member Settled In seal is on a distinguished road
    Join Date
    Mar 2008
    Posts
    28
    Rep Power
    0

    Re: Estrarre coordinate.... ...XML

    Grande tem.. proverò ad adattare questo codice al mio lavoro e ti farò presto sapere com'è andata!!!

    grazie!!! :D

  4. #4
    tem
    tem is offline
    Moderator Moving My Stuff To The FlepStudio tem is on a distinguished road tem's Avatar
    Join Date
    Jan 1970
    Posts
    753
    Rep Power
    44

    Re: Estrarre coordinate.... ...XML

    figurati!

    a presto!

+ Reply to Thread

Similar Threads

  1. estrarre tag xml ricevuto tramite chiamata a php
    By bulga in forum FLEX builder 3
    Replies: 1
    Last Post: 29-03-10, 12:49
  2. Estrarre coordinate.... ...XML /// Parte 2
    By seal in forum Flash CS3 | PHP | mySQL
    Replies: 2
    Last Post: 11-05-08, 10:30
  3. Estrarre coordinate.... ...XML
    By seal in forum Actionscript 3.0 avanzato
    Replies: 2
    Last Post: 23-04-08, 13:29
  4. estrarre nomi tag da xml
    By acca2o in forum Actionscript 3.0 base
    Replies: 1
    Last Post: 10-04-08, 09:17
  5. Estrarre una Substringa da una Stringa
    By Flep in forum Articoli e tutorials
    Replies: 0
    Last Post: 20-09-07, 13:14

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts