How do I get a image to appear in the image box when the mouse hovers over the linked word?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Pan
Posts: 1
Joined: Thu May 26, 2022 4:41 pm

How do I get a image to appear in the image box when the mouse hovers over the linked word?

Post by Pan » Fri May 27, 2022 12:55 pm

(FYI I am a complete beginner)

It's from livecode university and its not doing what it is supposed to.

Its supposed to make a picture appear in the image box when the mouse
hovers over a link.

here is the code

on linkClicked wordClicked
put wordClicked & ".jpg" into flowerPic
put image flowerPic into image "showPic"
end linkClicked

I have named everything accordingly but it doesn't do anything?

any help would be appreciated

cheers!

stam
Posts: 3069
Joined: Sun Jun 04, 2006 9:39 pm

Re: How do I get a image to appear in the image box when the mouse hovers over the linked word?

Post by stam » Fri May 27, 2022 2:33 pm

Hi Pan, and welcome!

The code of interest would actually be the call to the handler posted - I’m guessing either in a mouseMove handler?

The code seems OK, assuming you have a jpg with that name in your stack. But this needs something to trigger it - how are you calling this handler?

Stam

SparkOut
Posts: 2944
Joined: Sun Sep 23, 2007 4:58 pm

Re: How do I get a image to appear in the image box when the mouse hovers over the linked word?

Post by SparkOut » Fri May 27, 2022 3:55 pm

In other words, the linkClicked message only fires when the linkText is, er, clicked - there is no linkHover message.
So you will need to use something like (as stam suggested) a mouseMove or mouseChar or mouseCharChunk or mouseText handler to check the content under the mouse pointer, and decide whether it is over the "link" in which case you can trigger the image display.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10097
Joined: Fri Feb 19, 2010 10:17 am

Re: How do I get a image to appear in the image box when the mouse hovers over the linked word?

Post by richmond62 » Fri May 27, 2022 4:17 pm

While I have the LiveCode University backed up, I cannot get it to work on MacOS 12.5 beta because it is a 32-bit app.

So, what follows is guess work:
Its supposed to make a picture appear in the image box when the mouse
hovers over a link.
Makes NO sense at all, as the message is linkClicked:
-
SShot 2022-05-27 at 17.35.23.png
-
So, NO 'hover'; CLICK!

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10097
Joined: Fri Feb 19, 2010 10:17 am

Re: How do I get a image to appear in the image box when the mouse hovers over the linked word?

Post by richmond62 » Fri May 27, 2022 4:23 pm

This works as per the recipe:
-
FlowerPower.jpg
-
Attachments
Flower Power.livecode.zip
Stack.
(25.69 KiB) Downloaded 123 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10097
Joined: Fri Feb 19, 2010 10:17 am

Re: How do I get a image to appear in the image box when the mouse hovers over the linked word?

Post by richmond62 » Fri May 27, 2022 4:25 pm

Tangentially . . .

It might not be a bad idea if LiveCode central were to issue a Macintosh version of LiveCode University
that worked on 64-bit systems.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10045
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: How do I get a image to appear in the image box when the mouse hovers over the linked word?

Post by FourthWorld » Fri May 27, 2022 5:17 pm

richmond62 wrote:
Fri May 27, 2022 4:25 pm
Tangentially . . .

It might not be a bad idea if LiveCode central were to issue a Macintosh version of LiveCode University
that worked on 64-bit systems.
It would seem simpler to make it something that can be run right in the IDE, no?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10097
Joined: Fri Feb 19, 2010 10:17 am

Re: How do I get a image to appear in the image box when the mouse hovers over the linked word?

Post by richmond62 » Fri May 27, 2022 5:30 pm

It would seem simpler to make it something that can be run right in the IDE, no?
Yes, it would, and the reason that occurred to you and not to me is because you are
up there with the demigods, while I . . . well anyway, let's not go there. 8)
-
Yama.jpeg

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10045
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: How do I get a image to appear in the image box when the mouse hovers over the linked word?

Post by FourthWorld » Fri May 27, 2022 9:20 pm

Forget you and me, I'm more curious about the perceived benefit in the team for adding the extra step to their workload to turn it into a standalone that doesn't integrate with the IDE. :/
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10097
Joined: Fri Feb 19, 2010 10:17 am

Re: How do I get a image to appear in the image box when the mouse hovers over the linked word?

Post by richmond62 » Sat May 28, 2022 6:11 am

You could ask them why they did that.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10045
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: How do I get a image to appear in the image box when the mouse hovers over the linked word?

Post by FourthWorld » Sat May 28, 2022 5:38 pm

richmond62 wrote:
Sat May 28, 2022 6:11 am
You could ask them why they did that.
On the rare day when I have something truly insightful to offer I'll share it with them. Making tools for learning the IDE that operate directly in the context of use doesn't seem particularly insightful.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10097
Joined: Fri Feb 19, 2010 10:17 am

Re: How do I get a image to appear in the image box when the mouse hovers over the linked word?

Post by richmond62 » Sat May 28, 2022 11:21 pm

Quite . . . you know my view on that.

SparkOut
Posts: 2944
Joined: Sun Sep 23, 2007 4:58 pm

Re: How do I get a image to appear in the image box when the mouse hovers over the linked word?

Post by SparkOut » Sat May 28, 2022 11:43 pm

Richmond has demonstrated very nicely the linkClicked functionality.
Here is a version which demonstrates the ability for grouped text (where the textStyle is "link") to span over more than one word, and for the linkText to be set to something specific (in this case, the whole image name including .jpeg extension).
Then, to create the mouseOver "hover" effect, the mouseMove handler in the field will trigger according to the linkText of the mouseText.
Flower Power v2.zip
(25.43 KiB) Downloaded 134 times

Post Reply