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

Spread the love

L’ultima lezione per la realizzazione della nostra chat sviluppata in Flash per il nostro sito, ci permetterà di renderla più simpatica e gradevole dal punto di vista estetico, infatti doneremo un tocco di colore.

Secondo quanto abbiamo predisposto in precedenza (vedi lezione 1), oltre ai controlli di testo ed il pulsante invia, avremo altri controlli tra cui: pulsanti di selezione “refresh time” di 5 e 10 secondi. Il refresh da 5 secondi verrà inserito sul fotogramma numero 58-60 (è consigliabile il 60 per avere unaparità di valori durante l’utilizzo), mentre quello da 10 secondi sul fotogramma 118-120 (consigliabile 120 per le motivazioni di prima).
Il codice ActionScript che utilizzeremo per il refresh sarà il seguente:

Caso di refresh ogni 5 secondi:

if (reftime==1){
q = random(999999);
loadVariablesNum (“refresh.asp?q=”+q, 0, “POST”);
gotoAndPlay(1);
}

Caso di refresh ogni 10 secondi:

q = random(999999);
loadVariablesNum (“refresh.asp?q=”+q, 0, “POST”);

Inseriamo quindi in questo momento il codice ASP dello script refresh (lo esaminiamo con i soliti commenti per comprendere quello che stiamo facendo):

<%
Dim strLinea, FileObject, Instream, intVisite, intTipo, OutStream,allMsg
strFile = Server.MapPath(“msg.txt”)
‘Creiamo un oggetto
Set FileObject = Server.CreateObject(“Scripting.FileSystemObject”)
‘e lo apriamo in lettura
intTipo = 1
Set InStream = FileObject.OpenTextFile(strFile,IntTipo,true)
‘Leggiamo i messaggi dal file di testo
Do While not InStream.AtEndOfStream
         StrLinea = InStream.ReadLine()
         allMsg=allMsg&StrLinea&”<br />”
Loop
InStream.Close
Set InStream = Nothing
‘Inviamo tutti i messaggi alla chat Flash
Response.Write(“corpo=”&allMsg)
%>

Per una verifica finale, qualora decidessimo di aprire il file di testo, noteremmo una cosa del genere:

10.23.11 – <font color=’#FF0066′>Mario – ciao sono Mario</font>
10.22.58 – <font color=’#FF0066′>Luigi – ciao sono Luigi</font>

Ultimo passo è la creazione della pagina html che conterrà il nostro file chat.swf da creare con il seguente codice:

<html>
<head>
<title>La mia chat</title>
</head>
<body bgcolor=”#cccccc”>

<p>
<object type=”application/x-shockwave-flash” data=”chat.swf” width=”550″ height=”450″>
<param name=”movie” value=”chat.swf” />
<param name=”quality” value=”high” />
</object>
</p>

</body>
</html>

A lavoro terminato, salvare il file dando i permessi in lettura e scrittura completi su questo file.

Potremmo utilizzare così la nostra chat per rendere interattivo e dinamico il nostro sito web e cominciare ad avere nuovi rapporti con i nostri utenti molto spesso anonimi.

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

  1. Write more, thats all I have to say. Literally, it seems as though you relied on the
    video to make your point. You clearly know what youre talking about, why waste your intelligence on just posting videos to your weblog when you could be giving us something informative to read?

    Rispondi
  2. Having read this I thought it was really informative.

    I appreciate you spending some time and effort to put this short article together.
    I once again find myself personally spending way too much time both reading and leaving comments.
    But so what, it was still worth it!

    Rispondi
  3. whoah this weblog is wonderful i really like reading your posts.
    Keep up the good work! You know, a lot of individuals are searching around
    for this info, you can help them greatly.

    Rispondi
  4. My partner and I stumbled over here coming from a different website and thought I might check things out.
    I like what I see so now i’m following you. Look forward to going over your web page for a second time.

    Rispondi
  5. Thanks , I have recently been searching for information approximately this
    subject for ages and yours is the greatest I have came
    upon so far. But, what concerning the conclusion? Are you sure in regards to the supply?

    Rispondi
  6. First off I would like to say awesome blog! I had a
    quick question which I’d like to ask if you don’t mind.
    I was curious to find out how you center yourself and clear your mind prior
    to writing. I’ve had a tough time clearing my mind in getting my thoughts
    out there. I do enjoy writing however it just seems like the
    first 10 to 15 minutes tend to be wasted just trying to figure out how to begin. Any suggestions or tips?
    Many thanks!

    Rispondi
  7. Hi, I do think this is a great website. I stumbledupon it ;
    ) I am going to return yet again since I book-marked it.
    Money and freedom is the best way to change, may you be rich and continue to help others.

    Rispondi
  8. Great blog here! Also your website loads up very fast!
    What web host are you using? Can I get your affiliate
    link to your host? I wish my site loaded up as fast as yours lol

    Rispondi
  9. Нужна машинная штукатурка стен в Москве, но вы не знаете, какой подрядчик лучше выбрать? Обратитесь к нам на сайт mehanizirovannaya-shtukaturka-moscow.ru! Мы предоставляем услуги по механизированной штукатурке стен любой площади и сложности, а также гарантируем качество и надежность.

    Rispondi
  10. An impressive share! I have just forwarded this onto a colleague who was doing a little research on this. And he in fact bought me lunch because I found it for him… lol. So let me reword this…. Thank YOU for the meal!! But yeah, thanx for spending time to discuss this issue here on your web site.

    Rispondi
  11. Neat 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 shine.
    Please let me know where you got your theme. With
    thanks

    Rispondi
  12. Appreciating the persistence you put into your website and detailed information you provide.
    It’s awesome to come across a blog every once in a while that isn’t the same unwanted rehashed material.
    Fantastic read! I’ve saved your site and I’m including your RSS feeds
    to my Google account.

    Rispondi
  13. You could definitely see your enthusiasm in the article you write.
    The sector hopes for even more passionate writers like you who aren’t
    afraid to say how they believe. At all times go after
    your heart.

    Rispondi
  14. Howdy are using WordPress for your blog platform? I’m new to the blog world but I’m trying
    to get started and set up my own. Do you need any html coding
    knowledge to make your own blog? Any help would be really appreciated!

    Rispondi
  15. You actually make it seem so easy with your presentation but I find
    this matter to be actually something which I
    think I would never understand. It seems too complicated and extremely broad for
    me. I am looking forward for your next post, I will try to get the hang
    of it!

    Rispondi
  16. Does your blog have a contact page? I’m having a tough time locating it but,
    I’d like to send you an e-mail. I’ve got some recommendations for your blog you might be interested in hearing.
    Either way, great website and I look forward to seeing it develop over time.

    Rispondi
  17. Its like you read my mind! You appear to know so much about this, like you wrote the book in it or something.

    I think that you can do with some pics to drive the message home a
    bit, but other than that, this is wonderful blog.
    A great read. I’ll definitely be back.

    Rispondi
  18. Hi! Do you know if they make any plugins to assist with Search Engine Optimization? I’m
    trying to get my blog to rank for some targeted keywords but I’m not seeing very good results.
    If you know of any please share. Kudos!

    Rispondi
  19. I like the helpful info you provide in your articles.
    I will bookmark your weblog and check again here regularly.
    I am quite certain I will learn a lot of new stuff
    right here! Best of luck for the next!

    Rispondi
  20. Современный рынок предлагает нам множество уникальных решений, включая штукатурку механизированную. Проверьте mehanizirovannaya-shtukaturka-moscow.ru для получения подробной информации.

    Rispondi
  21. I’ve been surfing online more than 4 hours today, yet I never found any interesting article like
    yours. It is pretty worth enough for me. In my view, if all website
    owners and bloggers made good content as you did, the internet will be much more useful than ever before.

    Rispondi
  22. Excellent blog here! Also your website loads up
    very fast! What host are you using? Can I get your affiliate link
    to your host? I wish my web site loaded up as fast
    as yours lol

    Rispondi
  23. Great beat ! I wish to apprentice while you amend your
    web site, how could i subscribe for a blog web site?

    The account helped me a acceptable deal. I had been tiny bit acquainted of this your
    broadcast provided bright clear idea

    Rispondi
  24. I just like the valuable information you provide to your articles.
    I’ll bookmark your blog and check again right here regularly.
    I am rather certain I’ll be informed a lot of new stuff right here!
    Best of luck for the following!

    Rispondi

Lascia un commento