scrolling images
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 34
- Joined: Mon May 08, 2006 7:02 pm
scrolling images
I'm new to this, so I imagine my question will sound dumb, but here goes. I need an image field on a card that holds an image much larger than the card--that is, the field needs to have vertical as well as horizontal scroll bars to "move around' the image within the field that is on the card. I have tried several things and always end up with the image being resized inside the field and/or the scroll bars not doing anything. What am i missing? Also, is it possible to embed an image with the text inside of a scrolling text field? Thanks.
Group the image (yes, you can group single objects) and give the group a vertical and horizontal scrollbar. Set the lockloc of the group to true.
Best,
Mark
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 34
- Joined: Mon May 08, 2006 7:02 pm
Thanks for the help with the firstt part of the question. It turns out I was doing things in the wrong order. Any help on the second question, anybody? I'm still having trouble with the imageSource property to display a small image in a scrolling text field. I'm probably doing something backwards here, too.
Thanks.
Thanks.
Hi Scott,
I don't think I understand your question. Could you elaborate a bit and post your script?
Best,
Mark
I don't think I understand your question. Could you elaborate a bit and post your script?
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 34
- Joined: Mon May 08, 2006 7:02 pm
Sorry, I'm not very clear. I may not be using the correct terms. What I need to do is to have a small image (a diagram) to be included in a scrolling text field with the text. In other words, I need the image to act like a text character and to scroll with the text inside the text field. I noticed from the documentation that this was possible setting the imageSource property of a character in the text field. I'm just not sure how to accomplish it.
Thanks,
Scott
Thanks,
Scott
Hi Scott,
Malte is right and I thought you were trying what he proposes and somehow couldn't get it to work. You probably will want to set the fixedLineheight of the field to false, in case the image is slightly larger than the text.
Best,
Mark
Malte is right and I thought you were trying what he proposes and somehow couldn't get it to work. You probably will want to set the fixedLineheight of the field to false, in case the image is slightly larger than the text.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 34
- Joined: Mon May 08, 2006 7:02 pm
Thanks again for the help, but I still must be doing something wrong. This is the script I had used:
set the imageSource of char 1 of field "sample" to 1003
(sample is the name of my scrolling field and 1003 is the imageID)
I had also tried:
set the imageSource of char 1 of field "sample" to "test.jpg"
(sample is the name of my scrolling field and test.jpg is the imageName)
I tried it with the image on the same card, the image on a different card in the same stack, and even using a path name to the image on the hard drive. I assume I can just use the script editor to apply this script to the field. There are plentty of characters in the field, but the image never replaces the character. What am I missing?
Thanks,
Scott
set the imageSource of char 1 of field "sample" to 1003
(sample is the name of my scrolling field and 1003 is the imageID)
I had also tried:
set the imageSource of char 1 of field "sample" to "test.jpg"
(sample is the name of my scrolling field and test.jpg is the imageName)
I tried it with the image on the same card, the image on a different card in the same stack, and even using a path name to the image on the hard drive. I assume I can just use the script editor to apply this script to the field. There are plentty of characters in the field, but the image never replaces the character. What am I missing?
Thanks,
Scott
Scott,
What exactly are you doing? Did you put your syntax into the field script? Could you post your complete script? Did you import that image as a control or is it referenced?
Best,
Mark
What exactly are you doing? Did you put your syntax into the field script? Could you post your complete script? Did you import that image as a control or is it referenced?
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 34
- Joined: Mon May 08, 2006 7:02 pm
I just started from "scratch."
1. new main stack, saved as "untitled"
2. drag scrolling text field to card, named "sample"
3. typed test text into "contents" in inspector
4. imported as control onto same card "lamp2.jpg"
5. selected field "sample"
6. opened script editor and typed:
set the imageSource of char 1 of field "sample" to "lamp2.jpg"
7. clicked "apply" and closed script editor
Nothing happened. I'm missing something.
Thanks,
Scott
1. new main stack, saved as "untitled"
2. drag scrolling text field to card, named "sample"
3. typed test text into "contents" in inspector
4. imported as control onto same card "lamp2.jpg"
5. selected field "sample"
6. opened script editor and typed:
set the imageSource of char 1 of field "sample" to "lamp2.jpg"
7. clicked "apply" and closed script editor
Nothing happened. I'm missing something.
Thanks,
Scott
Scott,
Probably it is best to try this from the message box, first. What are you going to use it for? My guess is that you need a way to set the imagesource automatically, if the text in the field is going to change.
Best,
Mark
Probably it is best to try this from the message box, first. What are you going to use it for? My guess is that you need a way to set the imagesource automatically, if the text in the field is going to change.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
[blow my own horn mode]
And if you are interested, I have a chapter on working with the imageSource property in my free ebook you can find here:
http://www.derbrill.de/tutorials_e.html
[/toot toot]
All the best,
Malte
And if you are interested, I have a chapter on working with the imageSource property in my free ebook you can find here:
http://www.derbrill.de/tutorials_e.html
[/toot toot]
All the best,
Malte
-
- Posts: 34
- Joined: Mon May 08, 2006 7:02 pm
Mark, Malte,
Thanks. You've been a great help. As I said, I'm new at this, and some might say dumb. Maybe not dumb, but at least non-observant. I didn't even notice I wasn't executing the command and I didn't even think about the message box. I have used the message box now, and everything works fine. Hopefully, little things like this won't escape me as I work with it more.
What I'm working on is a simple interactive study guide for a history lesson that will be provided on CD. It has a timeline-based interface with windows that come up when items are clicked. On these windows are scrolling text fields with information, maps, etc. and also buttons to move to other areas of information.
Thanks again.
Scott
Thanks. You've been a great help. As I said, I'm new at this, and some might say dumb. Maybe not dumb, but at least non-observant. I didn't even notice I wasn't executing the command and I didn't even think about the message box. I have used the message box now, and everything works fine. Hopefully, little things like this won't escape me as I work with it more.
What I'm working on is a simple interactive study guide for a history lesson that will be provided on CD. It has a timeline-based interface with windows that come up when items are clicked. On these windows are scrolling text fields with information, maps, etc. and also buttons to move to other areas of information.
Thanks again.
Scott
Hi Scott,
An interactive study guide sounds cool. What exactly do you want to do with those images in the field? I'd like to know whether you need a dynamic solution, which allows for changing the text, or a static solution. If it is static, you could just execute the syntax from the message box, but if it is dynamic, you might want to explain how it is supposed to work --unless you have figured it all out by now.
Best,
Mark
An interactive study guide sounds cool. What exactly do you want to do with those images in the field? I'd like to know whether you need a dynamic solution, which allows for changing the text, or a static solution. If it is static, you could just execute the syntax from the message box, but if it is dynamic, you might want to explain how it is supposed to work --unless you have figured it all out by now.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode