Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 11:09 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Hyperlink troubles
PostPosted: February 18th, 2007, 10:55 am 
Offline

Joined: February 18th, 2007, 10:16 am
Posts: 1
Hi there, please help me!
I am working on a publication to store CDs and related musical segments. I get the song titles from an Acces DB and display them on a textobject while looping troughout the CD key. As a result the textobject has multiple rows, one for each title. Ad the end of the title I add a word "listen" and i create an hypertext on it. The action I have inserted is "Playsound" in order to make people listen the song they like to. Unfortunately when the pub runs all the hyperlinks start working together instead of waiting for the left mouse click. Besides it seems that i cannot stop them in any way....but quitting the pub.

Please let me know where i am making mistakes!

The code is as follows:

//Code to display songs on textobject
// cerca is the input varable to search for the CD
//Cod_brano is the single song ID
//titbran is the variable where the title is stored

var newStyle = new Object()
newStyle.bold = true
Textbox.SetSelectionStyle(newStyle)

text=corrente.toString() + ". " + titbran + " (Listen) "+ "\n"
lung=lung + text.length

Textbox.ReplaceSelection(text)
numbra[corrente]=lung
codbra[corrente]=cerca+Cod_brano

//Code to get the position of hyperlinks
//for every row i found the word "listen" and i create the hypertext whose action is the Suona(k) function.
text=""
for (k=1;k<numrec+1;k++)
{
Textbox.SetSelection(numbra[k],numbra[k]-12)
Textbox.CreateHypertext(Suona(k))


//Function description
//This function should play the song if the variable "suono" is off, otherwise it should stop it.

function Suona(k)
{
var asong=PlaySound("D:\\dischi\\brani\\"+codbra[k]+".mp3")


if (suono == "on") {
asong.Stop(true)
suono = "off"
} else {
PlaySound("D:\\dischi\\brani\\"+codbra[k]+".mp3")
asong.Stop(false)
suono = "on"

}
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Majestic-12 [Bot] and 47 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group