Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hyperlink in text cast member

Status
Not open for further replies.

Pattom

Technical User
Aug 17, 2007
3
US
I am reading an external text file and putting some of the text into a text cast member. I would like to use html formating and have hyperlinks show - with a mouseover hand, etc. - and automatically launch a browser from my projector (the executable will be distributed on a DVD-ROM). The hyperlink formating does not show; nor do I know how to set up my project so that it detects the default browser on the user's computer. I would appreciate any help you can provide. Thanks.
 
Set [tt]useHypertextStyles[/tt] to [tt]TRUE[/tt]

You don't need to specify the default browser. Just place this MovieScript:
Code:
on hyperlinkClicked(me, data, range)
  if offset("[URL unfurl="true"]http://",[/URL] data) then
    gotoNetPage(data)
  end if
end hyperlinkClicked

Kenneth Kawamoto
 
Thank you. I attached the above behavior to the sprite of my text cast member.

What I am trying to do is to pull up, based on choices I click on a menu, different html files residing on my hard drive into my text cast member. I use the command member("whatever").filename=<filename>

This is, apparently, not working because the hyperlinkclicked handler is not being called. Please tell me what I am doing wrong. How can I get my links to work when I pull in external linked html files into a text cast member?
 
Yes, please. I would appreciate that. Again, I am attaching the behavior to the sprite of the text cast member, but when I click on the sprite nothing happens. Thanks.
 
Create a new movie in 320 x 240. Then put this in the frame 1:
Code:
on exitFrame(me)
  _movie.go(_movie.frame)
end exitFrame
Create a HTML file called "external.htm" and place next to the DIR file:
Code:
<html>
<head></head>
<body bgcolor="#FFFFFF">
	Thank you. I attached the above <a href="[URL unfurl="true"]http://www.google.com/">behavior</a>[/URL] to the sprite of my text cast member. 
</body>
</html>
Create a Movie Script, then run the movie:
Code:
on prepareMovie()
  mem = new(#text)
  mem.fileName = _movie.path & "external.htm"
  mem.name = "externalHTML"
  mem.width = 300
end prepareMovie

on startMovie()
  channel(1).makeScriptedSprite(member("externalHTML", "UI"), point(10, 10))
end startMovie

on stopMovie()
  channel(1).removeScriptedSprite()
  member("externalHTML").erase()
end stopMovie

on hyperlinkClicked(me, data, range)
  if offset("[URL unfurl="true"]http://",[/URL] data) then
    gotoNetPage(data)
  end if
end hyperlinkClicked

Kenneth Kawamoto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top