Tutorial: Realizziamo una chat per il nostro sito (Lesson 1)

Spread the love

Oggi vedremo come realizzare una simpatica chat da inserire in un box del nostro sito web. Uno strumento leggero e utile per chi vuole cominciare ad entrare nel mondo della comunicazione virtuale.

Essendo alle prime armi utilizzeremo come supporto software un programma abbastanza comune e di semplice utilizzo: Adobe Macromedia Flash (il tutorial si basa sulla versione CS4). Questo per realizzare un’applicazione chat di piccole dimensioni e soprattutto semplicistica. Ovviamente riporto a guide più approfondite per la creazione di chat professionali.

Cominciamo preparando la base e quindi avviando il software dal menu Start, Tutti i programmi, Adobe, Macromedia Flash CS4.

Nel nostro scenario creato a piacere dall’utente con colori di sfondo, immagini roteanti o semplicemente testuale avremo bisogno di inserire:

– Testo dinamico con cui appariranno tutti i messaggi degli utenti
– Testi di immissione dati dove si potrà scrivere nome utente e messaggio
– Pulsante di invio per inviare il messaggio

Per chi volesse fare qualcosa di più creativo nelle ultime lezioni, come sempre dedicate ai più esperti vedremo come inserire:

– Pulsanti di cambio colore del testo
– Pulsanti di timeshift per la chat

Per un tipo di applicazione del genere, utilizzeremo come file di input/output un documento di testo che conterrà all’incirca una quindicina di messaggi e non di più, giusto per non appesantire l’applicazione.
Per fare questo abbiamo bisogno di introdurre gli script ASP (permettono di rendere dinamiche le pagine HTML) che serviranno distintamente ad effettuare l’acquisizione del messaggio e l’invio alla chat.

Ma cominciamo con realizzare la nostra interfaccia grafica:

Per prima cosa occorre creare e posizionare sullo scenario un “Campo di testo dinamico” che sarà il nostro contenitore di messaggi. A questo punto occorrerà creare due campi di testo per inserire rispettivamente il testo di Input (che chiameremo “messaggio”) ed un altro che chiameremo “utente” (dove ovviamente sarà inserito il nome utente.

Ora ci manca ancora qualcosa: il pulsante per inviare il messaggio.

Selezioniamo sempre dalla barra posta a destra l’opzione “Pulsante” ed associamo allo stesso delle righe di codice nel linguaggio ActionScript (nativo di Flash):

on (release, keyPress “<Enter>”) {
         stringa = “<font color='”+color+”‘>”+user+” _ “+msg+”</font>”;
         loadVariablesNum (“resp.asp”, 0, “POST”);
         msg = undefined;
         refresher.gotoAndPlay(1);
}

Con questo codice, noi diamo informazioni precise:
il pulsante viene attivato quando ci si preme sopra o quando si batte “Invio” sulla tastiera, Il pulsante immette il messaggio ed il nickname separando con il trattino basso l’user ed il messaggio. Alla fine, dopo l’immissione si ordina un refresh della chat.
Abbiamo visto fino ad ora come creare una mini chat non complessa in Flash, nelle prossime lezioni vedremo come ampliarla e perfezionarla ad hoc per le nostre esigenze.

1.284 commenti su “Tutorial: Realizziamo una chat per il nostro sito (Lesson 1)”

  1. non serve questo tutorial perchè è incompleto e assolutamente superficiale.
    mancano elementi e oggetti, azioni etc…

    che senso ha scrivere tutorial incompleti?????

    postate uil link dell’autore che fate prima ed evitare di far perdere tempo a chi ha voglia di fare dei tutorial completi per imparare e poi veere funzionare quelloc he ha studiato!

    Rispondi
    • Ciao Ciccio, probabilmente ti è sfuggita la funzione di ricerca nel motore di IoChatto 🙂
      Di seguito ti invio i link in cui il tutorial è stato concluso, perchè non lasciamo mai le cose incomplete per i nostri lettori…

      Seconda parte

      Terza parte

      Riguardo al mancare di elementi, oggetti e codici di azioni, ti assicuro che molti siti amatoriali utilizzano una chat (funzionante) realizzata grazie al nostro tutorial e di conseguenza molte e-mail di ringraziamento sono arrivate.
      Ovviamente qui non abbiamo realizzato una chat professionale, ma una semplice reply chat, anche perchè per una chat più complessa rimando ai manuali scritti da professionisti.
      Saluti e a presto…

  2. Howdy would you mind stating which blog platform you’re working with? I’m planning to start my own blog in the near future but I’m having a difficult time making a decision between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your design and style seems different then most blogs and I’m looking for something completely unique. P.S My apologies for getting off-topic but I had to ask!

    Rispondi
  3. Great goods from you, man. I’ve understand your stuff previous to and you’re just too fantastic. I really like what you’ve acquired here, really like what you’re stating and the way in which you say it. You make it entertaining and you still take care of to keep it smart. I cant wait to read far more from you. This is actually a terrific site.

    Rispondi
  4. Thank you for the auspicious writeup. It actually used to be a entertainment account it. Glance complicated to far brought agreeable from you! By the way, how can we keep up a correspondence?

    Rispondi
  5. Excellent post. I used to be checking continuously this blog and I am inspired! Very useful information specially the last part 🙂 I take care of such info a lot. I used to be seeking this particular info for a long timelong time. Thank you and good luck.

    Rispondi
  6. I loved as much as you will receive carried out right here. The sketch is tasteful, your authored subject matter stylish. nonetheless, you command get bought an edginess over that you wish be delivering the following. unwell unquestionably come further formerly again since exactly the same nearly a lot often inside case you shield this increase.

    Rispondi
  7. Appreciating the hard work you put into your website and in depth information you present. It’s good to come across a blog every once in a while that isn’t the same outdated rehashed material. Fantastic read! I’ve saved your site and I’m including your RSS feeds to my Google account.

    Rispondi
  8. You’re so cool! I don’t suppose I’ve read anything like this before. So nice to find somebody with a few unique thoughts on this issue. Really.. thank you for starting this up. This site is something that’s needed on the web, someone with a little originality!

    Rispondi
  9. Have you ever considered about including a little bit more than just your articles? I mean, what you say is fundamental and all. Nevertheless just imagine if you added some great graphics or video clips to give your posts more, “pop”! Your content is excellent but with images and clips, this site could undeniably be one of the greatest in its niche. Excellent blog!

    Rispondi
  10. Excellent post. I was checking continuously this blog and I am impressed! Very useful information particularly the last part 🙂 I care for such info a lot. I was seeking this particular info for a long time. Thank you and good luck.

    Rispondi
  11. Undeniably believe that that you stated. Your favourite justification appeared to be at the net the simplest thing to bear in mind of. I say to you, I definitely get irked at the same time as other people consider worries that they plainly do not understand about. You controlled to hit the nail upon the top as smartly as defined out the whole thing with no need side effect , folks can take a signal. Will likely be back to get more. Thank you

    Rispondi
  12. Hello there, just became aware of your blog through Google, and found that it is really informative. I’m gonna watch out for brussels. I will appreciate if you continue this in future. A lot of people will be benefited from your writing. Cheers!

    Rispondi
  13. Hmm is anyone else experiencing problems with the images on this blog loading? I’m trying to find out if its a problem on my end or if it’s the blog. Any feed-back would be greatly appreciated.

    Rispondi
  14. Can I simply say what a relief to discover somebody who really knows what they’re talking about on the web. You certainly understand how to bring an issue to light and make it important. More and more people need to read this and understand this side of the story. It’s surprising you aren’t more popular because you surely have the gift.

    Rispondi
  15. I simply could not depart your web site prior to suggesting that I really enjoyed the standard information a person supply in your visitors? Is going to be back steadily in order to check out new posts

    Rispondi
  16. Amazing blog! Is your theme custom made or did you download it from somewhere? A design like yours with a few simple adjustements would really make my blog jump out. Please let me know where you got your design. Many thanks

    Rispondi
  17. I used to be recommended this website by way of my cousin. I am not positive whether this post is written by way of him as no one else understand such particular approximately my problem. You are wonderful! Thank you!

    Rispondi

Lascia un commento