The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Mouse Click Function
grindle
post Sep 19 2012, 04:53 AM
Post #1





Group: Members
Posts: 2
Joined: 19-September 12
Member No.: 17,806



Hi,

I am relatively new to html, so please go easy.

I know what I want to do, but am a bit unsure how to tackle it

basically I want to show a graphic on a page

when the graphic is clicked, i want it to change

then play 1 of 4 sounds randomly from a library (url)

then when the sound is finished revert back to the first graphic

Its basically a head, click on the head, mouth opens, plays a random sound (1 of 4) then when the sound has finished the mouth closes.

Is this possible, i would be so grateful for any help.

I have looked at the mouse click function as a starting point

Thanks
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Sep 19 2012, 11:23 AM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



Well, this can't be done in HTML. Possibly with JavaScript, but I'm not sure about the bit you want to happen when the music stops. Maybe Flash would be the best option.

To be honest, JavaScript and sound has been pretty confusing to me the few times I've tried and I don't do Flash, so I can't offer more than in push in a better direction than HTML.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
grindle
post Sep 20 2012, 06:18 AM
Post #3





Group: Members
Posts: 2
Joined: 19-September 12
Member No.: 17,806



QUOTE(pandy @ Sep 19 2012, 11:23 AM) *

Well, this can't be done in HTML. Possibly with JavaScript, but I'm not sure about the bit you want to happen when the music stops. Maybe Flash would be the best option.

To be honest, JavaScript and sound has been pretty confusing to me the few times I've tried and I don't do Flash, so I can't offer more than in push in a better direction than HTML.


Well that's a start, I suspected it the solution wouldn't be HTML, I'll look into Java script

Thanks
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Sep 20 2012, 09:10 AM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



If you want I can move this thread to the JavaScript forum. Maybe Christian or someone else know how this works better than I do.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Sep 20 2012, 12:53 PM
Post #5


.
********

Group: WDG Moderators
Posts: 9,653
Joined: 10-August 06
Member No.: 7



I don't know much about JS sounds, except that I recall it's good to preload the audio files (as new Objects?) . I don't think it's possible to detect when a sound has stopped playing, maybe you can add a timer in the script and hope that the delay matches.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th April 2024 - 01:04 AM