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.490 commenti su “Tutorial: Realizziamo una chat per il nostro sito (Lesson 1)”

  1. Do you mind if I quote a few of your articles as long as I provide
    credit and sources back to your weblog? My blog is in the exact
    same area of interest as yours and my visitors would really benefit from some of the information you provide here.
    Please let me know if this ok with you. Regards!

    Rispondi
  2. Vaishnavi hospital provides emergency services,
    and the employees is always able to cater to the affected person’s needs.
    The overview workers should be appropriately credentialed.
    With over 25 publications and quite a few evaluation articles in reputed surgical journals, he continues to set benchmarks in advanced GI and HPB surgical procedure.
    It’s no shock that an area so saturated in human suffering
    continues to be haunted by the troopers who paid the ultimate sacrifice.
    Videos from the scene of the strikes displayed massive plumes of smoke over the area.
    The tags shall be only one part of this massive product-monitoring network.
    Lagacé-Wiens expects Manitoba will see a rise in COVID-19 numbers in the
    fall as children return to high school. In 1985, a
    life-measurement statue of Wadlow was erected reverse the Alton Museum of History and Art, situated on the
    campus of the Southern Illinois University School
    of Dental Medicine, formerly known as Shurtleff
    College, which Wadlow attended. First, clear the muddle,
    then start using feng shui in small methods.
    The industrial juggernaut acquired its begin as a simple service provider home.

    Rispondi
  3. I¦ve been exploring for a little bit for any high-quality articles or blog posts in this sort of area . Exploring in Yahoo I ultimately stumbled upon this web site. Studying this info So i¦m glad to convey that I’ve a very good uncanny feeling I found out just what I needed. I so much indisputably will make sure to don¦t put out of your mind this web site and give it a look regularly.

    Rispondi
  4. A formidable share, I simply given this onto a colleague who was doing a little bit analysis on this. And he in reality bought me breakfast as a result of I discovered it for him.. smile. So let me reword that: Thnx for the treat! However yeah Thnkx for spending the time to debate this, I really feel strongly about it and love reading more on this topic. If possible, as you turn into expertise, would you mind updating your blog with extra particulars? It’s highly helpful for me. Massive thumb up for this blog put up!

    Rispondi
  5. There’s this player I met who’s crazy about online gambling.
    He’s moved to Texas now, but his mother is originally from the Russian countryside.
    He’s in a relationship with another man and they both love hitting the virtual slots.

    What’s funny is he’s kind of fixated on Putin — says he thinks guys with a soft side
    are “supposed” to like him. Not sure I get it, but hey, people are weird like that.
    One thing’s for sure — he’s always
    winning when it comes to online casinos!
    You might also like this article — it’s where I’ve had the best luck

    Rispondi
  6. hey there and thank you for your information – I have definitely picked up something new from right here. I did however expertise several technical points using this site, as I experienced to reload the web site many times previous to I could get it to load correctly. I had been wondering if your web hosting is OK? Not that I am complaining, but sluggish loading instances times will very frequently affect your placement in google and can damage your high quality score if ads and marketing with Adwords. Well I’m adding this RSS to my e-mail and can look out for much more of your respective intriguing content. Make sure you update this again soon..

    Rispondi
  7. I’ve been surfing on-line greater than 3 hours as of late, yet I never found any attention-grabbing article like yours. It’s pretty value sufficient for me. Personally, if all web owners and bloggers made just right content material as you probably did, the net can be a lot more helpful than ever before.

    Rispondi

Lascia un commento