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

Spread the love

Cominciamo la nostra seconda lezione sulla creazione di una piccola chat da inserire in un box del nostro sito web, spiegando a cosa servono le righe di comando che abbiamo utilizzato nell’Action Script del pulsante Invia.

 

L’azione:

 

loadVariablesNum (“resp.asp”, 0, “POST”);

 

da l’avvio al inserimento del nuovo messaggio, effettua il refresh dei messaggi e pulisce il nostro campo di testo per inserire i nuovi messaggi.

Lo script di resp.asp, va comunque inserito in codice. Di seguito vedremo l’inserimento effettuato con i commenti per capire meglio passo passo cosa stiamo facendo:

<%
Dim strLinea, FileObject, Instream, intVisite, intTipo, OutStream, i, k, arrMsg(100), fine, allMsg
‘questa stringa permette l’utilizzo semplice in visualizzazione di : “username _ messaggio”
stringa = Trim(Request(“stringa”))
strFile = Server.MapPath(“msg.txt”)
definiamo l’oggetto creato in questo caso i messaggi che andranno in un file di testo
Set FileObject = Server.CreateObject(“Scripting.FileSystemObject”)
‘faccio la lettura del file
intTipo = 1 ‘ lettura
Set InStream = FileObject.OpenTextFile(strFile,IntTipo,true)
‘inseriamo il valore di data e ora al messaggio per fare in modo che in ordine cronologico siano aggiunti nella lista
i = 0
arrMsg(i) = FormatDateTime(Now(),3)&” – “&stringa
‘leggiamo il file di testo ed inseriamo i messaggi
Do While not InStream.AtEndOfStream
StrLinea = InStream.ReadLine()
i=i+1
arrMsg(i) = StrLinea
Loop
Set OutStream = FileObject.CreateTextFile(strFile, true)
‘determiniamo il numero massimo di messaggi
if i>15 then
fine=15
else
fine=i
end if
k=0
‘visualizziamo in Flash i messaggi inserendo il (br) a capo dove necessario
Do While k<=fine
OutStream.WriteLine(arrMsg(k))
allMsg=allMsg&arrMsg(k)&”<br />”
k=k+1
Loop
OutStream.Close
Set OutStream = Nothing
InStream.Close
Set InStream = Nothing
Set FileObject = Nothing
‘inviamo definitivamente i messaggi alla chat
Response.Write(“corpo=”&allMsg)
%>

Ecco, così abbiamo inserito il codice alla nostra chat e potremmo utilizzarla in modalità standard per dare la possibilità agli utenti del vostro sito di scambiare due chiacchiere. Ricordiamo che la versione utilizzata per la realizzazione di questo tutorial è l’ActionScript 4 incluso nella suite Adobe Macromedia Flash CS4 Professional.

Nella prossima ed ultima lezione, vedremo come dare un “tocco di colore” alla nostra chat.

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

  1. Предлагаем услуги профессиональных инженеров офицальной мастерской.
    Еслли вы искали ремонт приставок xbox адреса, можете посмотреть на сайте: ремонт приставок xbox в москве
    Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!

    Rispondi
  2. Chcesz znaleźć najlepsze kasyna online w Polsce i rozpocząć przygodę z grami kasynowymi w sieci? Na Game-cme.org czekają na Ciebie wyłącznie zweryfikowane, rzetelnie sprawdzone i rekomendowane platformy do gry. Sprawdź aktualny ranking TOP kasyn, skorzystaj z atrakcyjnych bonusów powitalnych oraz kodów promocyjnych i wybierz idealne miejsce do rozrywki. Zapraszamy do zapoznania się z naszym przewodnikiem! Wielu graczy zastanawia się, czy korzystanie z kasyn online w Polsce jest zgodne z prawem. Okazuje się, że krajowe przepisy w tej kwestii są wyjątkowo rygorystyczne. Wszystko za sprawą ustawy hazardowej z 2017 roku, która wymaga, aby każda platforma oferująca gry kasynowe online posiadała licencję wydawaną przez Ministerstwo Finansów. Jednak zdobycie takiego zezwolenia jest niemal niemożliwe, ponieważ spełnienie wymagań stawianych operatorom stanowi ogromne wyzwanie.

    Rispondi
  3. Od 2019 roku Pelican Casino jest jednym z liderów wśród kasyn online w Polsce. Nasza platforma oferuje szeroki wybór gier, które zadowolą każdego gracza. Dzięki atrakcyjnym bonusom i promocjom, zapewniamy niezapomniane wrażenia. Jednym z naszych wyróżników jest bonus powitalny, który wynosi 150% do 2000 zł oraz 100 darmowych spinów. Minimalny depozyt to tylko 125 PLN, co sprawia, że nasza strona jest dostępna dla każdego. Licencja Curaçao gwarantuje bezpieczeństwo i uczciwość rozgrywek. Pelican Casino to nie tylko różnorodność gier, ale także responsywny design strony i szybkie transakcje. Zachęcamy do założenia konta i skorzystania z naszej oferty, która z pewnością spełni Twoje oczekiwania.

    Rispondi
  4. We absolutely love your blog and find the majority of your post’s to be exactly what I’m looking for. Do you offer guest writers to write content to suit your needs? I wouldn’t mind composing a post or elaborating on a number of the subjects you write about here. Again, awesome weblog!

    Rispondi
  5. https://joyorganics.com/products/1000mg-cbd-cream produce a cautious and enjoyable method for the sake experiencing the exacerbate’s effects. Within reach in a broad series of flavors, strengths, and blends, they agree to looking for faithful dosing and manumit effects that be inclined to matrix longer. Numberless users addle to these gummies after their calming and stress-reducing benefits. That said, it’s basic to exercise them responsibly, as the initiation of effects is typically slower than with methods like smoking or vaping. At all times string dosage recommendations and verify that their avail is sound in your область prior to consuming or purchasing.

    Rispondi
  6. Καθώς τα χρόνια περνούν, η βιομηχανία του τζόγου συνεχώς εξελίσσεται, προσφέροντας ολοένα και περισσότερες επιλογές διασκέδασης. Τα καζίνο δεν αποτελούν απλώς χώρους παιχνιδιού, αλλά και εμπειρίες γεμάτες ένταση, όπου οι παίκτες αναζητούν τόσο τη διασκέδαση όσο και την πιθανότητα μεγάλων κερδών. Ειδικά στην Ελλάδα, όπου το πάθος για τα τυχερά παιχνίδια είναι βαθιά ριζωμένο, η δημοτικότητα του διαδικτυακού τζόγου αυξάνεται σταθερά. Μέσα σε αυτό το δυναμικό τοπίο, το Leon Casino έχει καταφέρει να ξεχωρίσει και να εδραιωθεί ως μία από τις πιο αξιόπιστες πλατφόρμες της αγοράς. Ο λόγος είναι προφανής: το Leon.bet Casino προσφέρει μια πλήρως εξοπλισμένη πλατφόρμα με πληθώρα επιλογών παιχνιδιών, διατηρώντας υψηλά πρότυπα ασφάλειας και ποιότητας στις υπηρεσίες του.

    Rispondi
  7. Kiedy jesteś w Holandii, ważne jest, aby upewnić się, że grasz w bezpiecznych kasynach. Poniżej przygotowaliśmy ranking najlepszych holenderskich kasyn online dla Polaków. Jesteśmy grupą doświadczonych graczy, programistów, autorów i entuzjastów hazardowej rozrywki. Podobnie jak wielu z was – jesteśmy pasjonatami hazardu i dostarczamy tylko sprawdzone i wiarygodne informacje na stronie. Poniżej dowiesz się, jak wybrać niezawodny zakład w Holandii, zarejestrować się i otrzymać bonusy. Jeśli nadal nie jesteś zdecydowany, które holenderskie kasyno online wybrać dla rozrywki, zapoznaj się z naszą listą.

    Rispondi
  8. I think this is among the so much vital info for me. And i’m happy reading your article. But wanna remark on few common issues, The site style is wonderful, the articles is really excellent : D. Just right job, cheers

    Rispondi
  9. I just couldnt leave your website before saying that I really enjoyed the useful information you offer to your visitors… Will be back often to check up on new stuff you post!

    Rispondi
  10. Sweet blog! I found it while browsing on Yahoo News. Do you have any tips on how to get listed in Yahoo News? I’ve been trying for a while but I never seem to get there! Thank you

    Rispondi
  11. Great write-up, I am a big believer in placing comments on sites to inform the blog writers know that they’ve added something advantageous to the world wide web!

    Rispondi
  12. I just wanted to take a moment to express my gratitude for the great content you consistently produce. It’s informative, interesting, and always keeps me coming back for more!

    Rispondi
  13. Abnormal this put up is totaly unrelated to what I was searching google for, but it surely used to be listed at the first page. I suppose your doing one thing proper if Google likes you adequate to place you at the first page of a non similar search.

    Rispondi
  14. Hey! awesome blog! I happen to be a daily visitor to your site (somewhat more like addict 😛 ) of this website. Just wanted to say I appreciate your blogs and am looking forward for more!

    Rispondi
  15. reparación de maquinaria agrícola
    Sistemas de ajuste: fundamental para el operación suave y óptimo de las maquinarias.

    En el mundo de la ciencia moderna, donde la efectividad y la estabilidad del aparato son de gran importancia, los dispositivos de ajuste tienen un rol esencial. Estos equipos especializados están creados para calibrar y asegurar componentes dinámicas, ya sea en herramientas manufacturera, vehículos de traslado o incluso en dispositivos domésticos.

    Para los expertos en soporte de equipos y los ingenieros, utilizar con sistemas de balanceo es crucial para garantizar el funcionamiento fluido y fiable de cualquier sistema dinámico. Gracias a estas opciones innovadoras innovadoras, es posible reducir significativamente las oscilaciones, el zumbido y la esfuerzo sobre los soportes, aumentando la tiempo de servicio de elementos caros.

    De igual manera importante es el rol que desempeñan los equipos de calibración en la asistencia al comprador. El asistencia experto y el reparación regular utilizando estos aparatos facilitan ofrecer soluciones de óptima calidad, mejorando la agrado de los clientes.

    Para los responsables de proyectos, la inversión en unidades de balanceo y dispositivos puede ser esencial para optimizar la rendimiento y desempeño de sus aparatos. Esto es sobre todo significativo para los dueños de negocios que gestionan pequeñas y modestas empresas, donde cada elemento cuenta.

    También, los aparatos de calibración tienen una vasta implementación en el área de la protección y el gestión de nivel. Facilitan localizar probables defectos, previniendo arreglos costosas y perjuicios a los equipos. También, los información recopilados de estos aparatos pueden aplicarse para perfeccionar sistemas y potenciar la reconocimiento en buscadores de investigación.

    Las sectores de uso de los dispositivos de balanceo comprenden numerosas áreas, desde la elaboración de vehículos de dos ruedas hasta el monitoreo ambiental. No afecta si se considera de grandes manufacturas industriales o limitados locales hogareños, los dispositivos de equilibrado son esenciales para proteger un desempeño productivo y sin detenciones.

    Rispondi
  16. I’ve started using CBD gummies, and they’ve made a significant difference in my routine. They’re uncomplicated to abuse, disposition tremendous, and take under one’s wing a severe distance to embody CBD into my day. I’ve rest they help me ease and rehabilitate my nap after a long light of day, which has been a colossal benefit. The consistent CBD dosage in each gummy is a big plus representing managing intake. If you’re looking at CBD, gummies are an save recourse to start with—just bring about steadfast you decide a trustworthy brand for the benefit of the most adroitly results!

    Rispondi

Lascia un commento