On 06/15/2011 09:13 AM, Timothy Miller wrote:
Greetings,

I thought I knew how to do this, but it isn't working out.

I'm making a stack that will help me practice identifying birds. One card per species. 
Images and songs, mostly, plus a few fields for habitat, seasonality and so on. Some 
fields and buttons will be common to all cards, but most fields will not "share 
text." Each card will have different images.

Chances are I will gradually add fancy bells and whistles. I'll want to hide 
the name of the species, for instance, forcing myself to name the species by 
song or image, then show the name to see if I got it right. That sort of thing. 
I think I know how to do most of what I plan.

At the moment, I'm stuck on a basic problem, and I hope someone will help 
un-stick me.

I want to be able to make a new card, quickly and conveniently, type the name 
of the species into a field designated for that purpose, then paste several 
images onto the card -- as many as desired.

The first thing you really need to do is set up a template card with your textField; perhaps
with a button next to it with the following type of script in it:

on mouseUp
  if the visible of field "TWEET" is true then
    set the visible of field "TWEET" to false
  else
    set the visible of field "TWEET" to true
  end if
end mouseUp

and a pair of navigation buttons to trot back and forth between your cards.

You can then duplicate the template as many times as you like: Edit/Duplicate Card
(this ONLY works when you have the Object Inspector open for the card).

The total area of the images will be quite a bit larger than the total area of 
the card, so I want the images to scroll vertically while retaining their 
positions, relative to each other. I don't mind dragging the new images to 
their desired locations manually.

There's something basic I'm not getting.

I thought if I pasted several images onto a card, scroll bars would magically 
appear, which would scroll the images as a group. Not happening. Maybe 
backgrounds scroll but stacks and cards don't?

Hyuck, hyuck, hyuck. The difference between Livecode and "yer bog-standard flashcard thingy"
is VAST; Livecode is a full-blown programming language.

If you import a folder of images onto a card: File/Import As Control/All Images In Folder . . .

select them all: Edit/Select All

then select Object Inspector: Object/Object Inspector

then look at Align Objects: Distribute/Edge To Edge

then Group them: Object/Group Selected

then look at Size & Position in the Object Inspector and CENTRE your group,

set the group's width & height to what you want,

then look at Basic properties in the Object Inspector and select the Horizontal scrollbar.

At this point you should have a number of pictures of tweety-birds in a group such that you can only see one picture at a time, and you can scroll left & right between them.

I made a scrolling group, pasted multiple pictures in it. That works on one card. But if I set bgBehavior to 
"true," then "new card" duplicates all the pictures, and the pictures are shared between 
cards. I want different pictures on each card. If I set bgBehavior to "false," making a new card 
becomes complicated.

(I'm a hyperCard retread, so setting bgBehavior to "false" don't come natchrel.)

Sadly, I have a feeling you will have to do this manually; or go a totally different route . . .

call your template card "TWEETY" via the Obj. Inspector.

Your template should NOT contain any images.

So; let's have a button on the template card called "DO IT BABY" with the following sort
of script:

on mouseUp
 clone card "TWEETY"
 set the name of card "TWEETY" to "TWEETY2"
--obviously this is a bit daft, you could have a field that counts the cards and assigns them numbers as they are cloned---

{this is where you can have your import routine}

select all

--this is where I get stuck as I cannot, for the life of me find out the language equivalents of
the alignment commands in the Obj. Inspector--

group the selected
call it "BLUETIT"
move group "BLUETIT" to 400,400 --always supposing your stack is 800,800--
set the width of group "BLUETIT" to 700
set the height of group "BLUETIT" to 600
set the hScrollbar of field "BLUETIT" to true

end mouseUp

I don't need detailed instructions or scripts. Just a few hints.

Maybe I need to make a scrolling stack with scrollbar buttons, which I would 
script as needed, instead of depending on the native scroll bars you get with a 
scrolling group? Hmm... In that case, I guess I'd need to place the scroll bars 
on each new card...

Maybe I need to place a different group on each new card with bgBehavior set to false? 
Maybe a "new card" button with a script that places a new group on the new 
card, sets its rect and size and other characteristics?

Maybe there's more than one way to do what I want... probably so...


Thanks in advance.


Tim


Sorry; I have a feeling all this will do is make you reach for the aspirin.

Richmond Mathewson.

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to