Background Fields during Import
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Background Fields during Import
I'm running LiveCode version 6.7.0 dp5. I'm trying to import an old Hypercard stack to get started. I am running into lots of problems and have many questions. I'll start with the biggest issue. My stack has a single background and about 18 000 cards. When I go to the previous card, or indeed any card but the last card, the fields all disappear. Is there a concept of background fields in LiveCode or are they somehow only on a single card?
Re: Background Fields during Import
Hi mf2k,
The equivalent of the hypercard background in Live Code is groups with background behavior.
To manage it have a look at "group","backgroundbehavior", "place group" in the LC dictionary
Best regards
Jean-Marc
Yes.Is there a concept of background fields in LiveCode or are they somehow only on a single card?
The equivalent of the hypercard background in Live Code is groups with background behavior.
To manage it have a look at "group","backgroundbehavior", "place group" in the LC dictionary
Best regards
Jean-Marc
https://alternatic.ch
Re: Background Fields during Import
Hi.
This is likely the single greatest difference in simply translating HC concepts to LC ones. So much is similar; this one requires just a bit of rethinking.
Know also that in HC, 18,000 cards was no big deal. But in LC, you will notice a slowdown with such a large, er, stack. This has always, been, to me, the single greatest weakness of LC. You are good with a handful of thousands of cards or so, though. No speed hit at that level.
Fortunately, there are simple workarounds, mainly using external files or SQL. Others will be more conversant with that sort of thing.
Craig Newman
This is likely the single greatest difference in simply translating HC concepts to LC ones. So much is similar; this one requires just a bit of rethinking.
Know also that in HC, 18,000 cards was no big deal. But in LC, you will notice a slowdown with such a large, er, stack. This has always, been, to me, the single greatest weakness of LC. You are good with a handful of thousands of cards or so, though. No speed hit at that level.
Fortunately, there are simple workarounds, mainly using external files or SQL. Others will be more conversant with that sort of thing.
Craig Newman
Re: Background Fields during Import
Hi,
I understand you have one background for 18'000 cds.
As said Craig, you can have just one card and external files.
When you go to an other content you have just to import what you want in this cd
For text:
For image:
reference file way
Import image
For sound:
or
Best regards
Jean-Marc
I understand you have one background for 18'000 cds.
As said Craig, you can have just one card and external files.
When you go to an other content you have just to import what you want in this cd

For text:
Code: Select all
put url("file:" & MyPathFile) into fld "MyField"
reference file way
Code: Select all
set the filename of img "MyImage" to MyPathFile
Code: Select all
import paint from file "MyPathFile"
Code: Select all
play MyPathFileSnd
Code: Select all
set the filename of player "MyPlayer" to MyPathFileSnd
Jean-Marc
https://alternatic.ch
Re: Background Fields during Import
Thanks for the responses. I clearly don't get it. It appears that all of my fields are in a single group and that group is a "background group". But all of the fields disappear when I go to any card but the last card. What am I missing so I can make this work?
Re: Background Fields during Import
To be more clear. My group with all fields has the following object properties checked:
- "Shared Group"
- "Behave like a background"
- "Shared Group"
- "Behave like a background"
Re: Background Fields during Import
Hi.
OK.
Unlike a background in HC, which was a native object class, the whole thing was transposed to the concept of groups. These groups can have many of the attributes of the old backgrounds, but they are owned by the cards they reside on.They do not occupy a "space" of their own.
So you can have a group with its background behavior set to "true", but that does not automatically place it on every card in a stack (backGround). This is a process that you must manage yourself, and is very likely what you are seeing after you finally got your HC stack ported over.
A couple of examples:
1- If, on a new stack, you make a group and set its background behavior, then any new card you make will contain that group. And just like in HC, you may or may not set such properties of, say, a field owned by that group, such as the sharedText. This would operate just as it does in HC. In this sense you would least notice the difference, even though there are no backgrounds at all. One small advantage is that there is only one kind of control; there are no longer "cd fld" and "bg fld" control types. There are only fields.
2- Let's say you already have a stack of many cards. You create a new group somewhere and set its backGroundBehavior to "true". Unlike HC, that group will only reside on the card you created it on. It is just an object on the card. It does NOT automatically appear on each card in the current "backGround", as it would in HC.
There are commands to do this very thing though, and I would like you to look up the "place" command in the dictionary. Try this sort of thing at home. Experiment as I indicated above. You will first find the concept clunky and unintuitive. The loss of that bg object will seem like a catastrophe. But there is great flexibility in the new paradigm. You will see....
Write back with your woes. I bet the carry-over of your HC stack orphaned a group and made it local to one card.
Craig Newman
OK.
Unlike a background in HC, which was a native object class, the whole thing was transposed to the concept of groups. These groups can have many of the attributes of the old backgrounds, but they are owned by the cards they reside on.They do not occupy a "space" of their own.
So you can have a group with its background behavior set to "true", but that does not automatically place it on every card in a stack (backGround). This is a process that you must manage yourself, and is very likely what you are seeing after you finally got your HC stack ported over.
A couple of examples:
1- If, on a new stack, you make a group and set its background behavior, then any new card you make will contain that group. And just like in HC, you may or may not set such properties of, say, a field owned by that group, such as the sharedText. This would operate just as it does in HC. In this sense you would least notice the difference, even though there are no backgrounds at all. One small advantage is that there is only one kind of control; there are no longer "cd fld" and "bg fld" control types. There are only fields.
2- Let's say you already have a stack of many cards. You create a new group somewhere and set its backGroundBehavior to "true". Unlike HC, that group will only reside on the card you created it on. It is just an object on the card. It does NOT automatically appear on each card in the current "backGround", as it would in HC.
There are commands to do this very thing though, and I would like you to look up the "place" command in the dictionary. Try this sort of thing at home. Experiment as I indicated above. You will first find the concept clunky and unintuitive. The loss of that bg object will seem like a catastrophe. But there is great flexibility in the new paradigm. You will see....
Write back with your woes. I bet the carry-over of your HC stack orphaned a group and made it local to one card.
Craig Newman