Page 1 of 1

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

Posted: Fri May 27, 2022 12:55 pm
by Pan
(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!

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

Posted: Fri May 27, 2022 2:33 pm
by stam
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

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

Posted: Fri May 27, 2022 3:55 pm
by SparkOut
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.

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

Posted: Fri May 27, 2022 4:17 pm
by richmond62
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!

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

Posted: Fri May 27, 2022 4:23 pm
by richmond62
This works as per the recipe:
-
FlowerPower.jpg
-

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

Posted: Fri May 27, 2022 4:25 pm
by richmond62
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.

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

Posted: Fri May 27, 2022 5:17 pm
by FourthWorld
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?

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

Posted: Fri May 27, 2022 5:30 pm
by richmond62
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

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

Posted: Fri May 27, 2022 9:20 pm
by FourthWorld
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. :/

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

Posted: Sat May 28, 2022 6:11 am
by richmond62
You could ask them why they did that.

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

Posted: Sat May 28, 2022 5:38 pm
by FourthWorld
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.

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

Posted: Sat May 28, 2022 11:21 pm
by richmond62
Quite . . . you know my view on that.

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

Posted: Sat May 28, 2022 11:43 pm
by SparkOut
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 133 times