[Gambas-user] WebAudio, custom commands.

Bruce Steers bsteers4 at gmail.com
Wed Jul 20 11:42:25 CEST 2022


Well that was really confusing.
Ironically i had already made similar modifications to your suggestions but
still it did not work.

It was this line...

$_(idx + ':entry').value = elt.currentTime;

what was confusing was it looked identical to the line you sent but did not
work.

I found there was an invisible character after the x of idx for some
strange reason.

after deleting it now it all works as expected.

Many thanks for your help :)
BruceS


On Tue, 19 Jul 2022 at 19:31, Safiur Rahman <isafiur at gmail.com> wrote:

> Hi Bruce
>
> Attached a project to demonstrate. Just rename audio.txt to audio.js
> present in js foldwer
>
>
> On Tue, Jul 19, 2022 at 11:53 PM Safiur Rahman <isafiur at gmail.com> wrote:
>
>> Hi
>>
>> gettime  is used elsewhere. So use some other function name
>>
>> On Mon, 18 Jul 2022, 21:02 Safiur Rahman, <isafiur at gmail.com> wrote:
>>
>>> Hi Bruce
>>>
>>> I think you can do it in the following way:
>>>
>>> a) Add Javascript to lib.js or write separately.
>>> eg.
>>> sound:
>>>   {
>>>     getaudiotime: function(id, idx)
>>>     {
>>>       var elt = $_(id);
>>>       $_(idx + ':entry').value = elt.currentTime;
>>>     },
>>>
>>>     .......
>>>     .........
>>>
>>>  b) Use WebTextBox to get the value. When I click a WebButton
>>>
>>>  Public Sub WebButton1_Click()
>>>
>>>   WebForm._AddJavascript("gw.sound.getaudiotime(" & JS(WebAudio1.Name) &
>>> ", " & JS(WebTextBox2.Name) & ")")
>>>
>>> End
>>>
>>> The WebTextBox is populated with the required value.
>>>
>>> --
>>> Regards
>>> Safiur Rahman
>>>
>>
>
> --
> Regards
> Safiur Rahman
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20220720/c2344ece/attachment.htm>


More information about the User mailing list