Cadilhe Posted August 27, 2014 Share Posted August 27, 2014 Hello, i'm doing some tests with Unigui and i need to know how to call ClientEvents.ExtEvents 'OnClick' from a UniButton from pascal code. Thanks in advance. João Cadilhe. Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted August 27, 2014 Administrators Share Posted August 27, 2014 Client events are to be called from client side. Link to comment Share on other sites More sharing options...
Cadilhe Posted August 27, 2014 Author Share Posted August 27, 2014 Client events are to be called from client side. Hi, Farshad, i need to play a .wav file in ontimer event of a TUnitimer, i have this working well with a Tbutton But UniTimer doesn't have clientevents. I'm trying to play the .wav file in ontimer event using the client event of the button. Is it possible? Thanks. João Cadilhe. Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted August 27, 2014 Administrators Share Posted August 27, 2014 But UniTimer doesn't have clientevents. It does. ClientEvent Link to comment Share on other sites More sharing options...
Cadilhe Posted August 27, 2014 Author Share Posted August 27, 2014 Thank you, Farshad! My screen was too close:), Link to comment Share on other sites More sharing options...
Cadilhe Posted August 27, 2014 Author Share Posted August 27, 2014 { var audio1 = document.createElement('audio'); audio1.setAttribute('src', 'files/OK.wav'); audio1.play(); } it's ok on Button.ClientEvents.ExtEvents; Same code and no sound with Unitimer.ClientEvent. Any idea? João Cadilhe. Link to comment Share on other sites More sharing options...
Sherzod Posted August 28, 2014 Share Posted August 28, 2014 Hi Cadilhe.Maybe you're doing something wrong ...Works for me! (may be a difference in the versions? I tested on version 0.94) 1. 2. Or try this: procedure TMainForm.UniTimer1Timer(Sender: TObject); begin UniSession.AddJS('var audio1 = document.createElement(''audio'');' + 'audio1.setAttribute(''src'', ''files/sndBird.wav'');'+ 'audio1.play();'); end; Best regards. Link to comment Share on other sites More sharing options...
Cadilhe Posted August 28, 2014 Author Share Posted August 28, 2014 Hi Cadilhe. Maybe you're doing something wrong ... Works for me! (may be a difference in the versions? I tested on version 0.94) 1. sndTimer.png 2. Or try this: procedure TMainForm.UniTimer1Timer(Sender: TObject); begin UniSession.AddJS('var audio1 = document.createElement(''audio'');' + 'audio1.setAttribute(''src'', ''files/sndBird.wav'');'+ 'audio1.play();'); end; Best regards. Thank you Delphi Developer! Possible 0.96 problem. Now it's ok. João Cadilhe. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now