using imageSource with htmlText in a field

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dave_probertGA6e24
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 328
Joined: Mon Dec 05, 2011 5:34 pm
Contact:

using imageSource with htmlText in a field

Post by dave_probertGA6e24 » Sun Sep 16, 2012 5:27 pm

Hi,

I'm playing with code trying to develop some simple Flashcard like stuff using html text files and external images.

I'm not really wanting to use a Browser Object as I think that might be overkill and possibly problematic, so I'm loading the html files into an array and just replacing the htmlText in a field for the next screen. It's a single card with a single field (and a next button).

The problem I'm facing is that I'd like to display the images in the field too. I have used the imageSource route before to set dynamic images for single characters in list fields - that worked great ;), but it doesn't seem to work with the htmlText field. Can anyone confirm that this is possible or not?

I'm currently putting placeholder "$" characters in the html and then using code like: set the imageSource of char n of field "the_field" to tFile
where n is the char number of the "$", and tFile is the path of the file on disk (it's correct btw)

The above makes the "$" vanish, but no picture appears :(

I hope that all makes sense - if not then I can clarify any parts that don't.
Any help would be appreciated.

Cheers,
Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: using imageSource with htmlText in a field

Post by Klaus » Sun Sep 16, 2012 5:33 pm

Hi Dave,

that definitively works, just tested!

Do you use the syntax with "binfile:" like in the dictionary?
...
set the imageSource of char n of field "the_field" to ("binfile:" & tFile)
...


Best

Klaus

dave_probertGA6e24
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 328
Joined: Mon Dec 05, 2011 5:34 pm
Contact:

Re: using imageSource with htmlText in a field

Post by dave_probertGA6e24 » Sun Sep 16, 2012 5:42 pm

Hi Klaus,

You are an excellent person :)

That was precisely the problem. Added the bin part and voila - images appear!

It's late in the evening here in Thailand and I'm tired - missed the bin!

Thanks again,

Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.

Post Reply