1 / 6

Създаване на DHTML приложение

Създаване на DHTML приложение. 1. Потребителски интерфейс. 2. Поставяне на елементите на приложението. 3. Кодиране на бутона. Private Function Button1_onclick() As Boolean 'Declare local variable x for wins (copied to 'Property Bag between spins) Dim x 'Pick three random numbers

warren
Download Presentation

Създаване на DHTML приложение

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Създаване на DHTML приложение

  2. 1. Потребителски интерфейс

  3. 2. Поставяне на елементите на приложението

  4. 3. Кодиранена бутона Private Function Button1_onclick() As Boolean 'Declare local variable x for wins (copied to 'Property Bag between spins) Dim x 'Pick three random numbers Num1.innerText = Int(Rnd * 10) Num2.innerText = Int(Rnd * 10) Num3.innerText = Int(Rnd * 10) 'If any number is 7 display coin stack and beep If Num1.innerText = 7 Or Num2.innerText = 7 Or Num3.innerText = 7 Then 'If we have a winner, play .wav file (applause.wav) MMControl1.Command = "Prev" 'rewind if necessary MMControl1.Command = "Play" 'play .wav file 'and increment the win count in the Property Bag x = GetProperty("Wins") Result.innerText = "Wins: " & x + 1 PutProperty "Wins", x + 1 End If End Function

  5. 4. Кодиранепри зареждане на страницата Private Sub DHTMLPage_Load() LuckyHead.Style.textDecorationUnderline = True'Set underline style for heading Num.Style.Color = "blue“'Set color style of numbers to blue Randomize'seed random number generator (for truly random spins) Image1.src = "c:\vb6sbs\less22\coins.wmf“'Display coin stack 'Configure and open Multimedia MCI control MMControl1.Notify = False MMControl1.Wait = True MMControl1.Shareable = False MMControl1.DeviceType = "WaveAudio" MMControl1.FileName = "c:\vb6sbs\less22\applause.wav" MMControl1.Command = "Open" 'Use GetProperty function to determine if anyprevious wins exist in the Property Bag (a storage 'location that persists during HTML page load andunload operations). 'With this code you can save 'the number of wins between jumps to the "AboutLucky 7" hyperlink or other Web pages. Result.innerText = "Wins: " & GetProperty("Wins") End Sub

  6. 4. Тестване • Компилирайте програмата • Отстранете грешките

More Related