simple custom property question

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

simple custom property question

Charles Hartman
This has got to be simple, but I'm stuck: how do I get a group into a  
custom property? I don't even need to do it from a script; the msg  
box or Inspector will do.

The group includes an image and a bunch of little fields. I want them  
in a cust prop because I'll have a lot of them and I want to automate  
sending them to a dialog box.

Hope the question is coherent.

Charles Hartman

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: simple custom property question

Ken Ray
On 8/1/05 7:44 AM, "Charles Hartman" <[hidden email]> wrote:

> This has got to be simple, but I'm stuck: how do I get a group into a
> custom property? I don't even need to do it from a script; the msg
> box or Inspector will do.
>
> The group includes an image and a bunch of little fields. I want them
> in a cust prop because I'll have a lot of them and I want to automate
> sending them to a dialog box.

How about just creating the group in an offscreen stack (or substack) and
then doing "copy group <groupDesc> to <targetLoc>" every time you want an
"instance" of the group?

Otherwise, you can't really store a true group object inside a custom
property AFAIK - you could store the binary of a stack with one card that
only had your group on it, or you could store the specifications of all the
objects that make up the group and then build it from scratch each time
based on the specifications for each object.

But personally, I'd suggest the "copy group" approach...


Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: [hidden email]


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: simple custom property question

Charles Hartman
So "any kind of data" (as in, "You can define custom properties for  
any object, and use them to store any kind of data.") doesn't mean  
"any kind of data," it means various "multimedia" kinds of data --  
but not Rev objects?

Since the rest of the data I need to send to each instance of the  
dialog will be stored in an array built from custom properties --  
that seems to be the Rev-"native" way to do it -- it feels peculiar  
to have to call up a different data stream for the operation. I  
suppose I'm just being fussy.

I wonder if this limitation (if I understand it correctly) gets in  
anyone else's way?

Charles

On Aug 1, 2005, at 12:06 PM, Ken Ray wrote:

> On 8/1/05 7:44 AM, "Charles Hartman" <[hidden email]>  
> wrote:
>
>
>> This has got to be simple, but I'm stuck: how do I get a group into a
>> custom property? I don't even need to do it from a script; the msg
>> box or Inspector will do.
>>
>> The group includes an image and a bunch of little fields. I want them
>> in a cust prop because I'll have a lot of them and I want to automate
>> sending them to a dialog box.
>>
>
> How about just creating the group in an offscreen stack (or  
> substack) and
> then doing "copy group <groupDesc> to <targetLoc>" every time you  
> want an
> "instance" of the group?
>
> Otherwise, you can't really store a true group object inside a custom
> property AFAIK - you could store the binary of a stack with one  
> card that
> only had your group on it, or you could store the specifications of  
> all the
> objects that make up the group and then build it from scratch each  
> time
> based on the specifications for each object.
>
> But personally, I'd suggest the "copy group" approach...
>
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

RE: simple custom property question

Lynch, Jonathan
In reply to this post by Charles Hartman
A custom prop can store characters of various sorts...

And all digital data is ultimately stored as some sort of collection of
characters, including images, video, sound files, etc...

So, if you had a way to convert a Rev object into characters, the way
imagedata gives you the characters that define an image, then you could
indeed store that object as a custom property.

I believe this could be done, but it would be a serious pain in the
bahonkus to do it.

For a group, you would have to get all the properties of the group, and
all the objects and their properties that are contained in the group,
and store all of that data in a well delimited chunk of text.

A limited version of this approach is what I do for storing data that I
use in my spreadsheet object, but it took me a fair bit of work to work
out. So I would suggest not doing this unless you absolutely need to.

But yes, it can be done.

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Charles
Hartman
Sent: Monday, August 01, 2005 1:49 PM
To: How to use Revolution
Subject: Re: simple custom property question

So "any kind of data" (as in, "You can define custom properties for  
any object, and use them to store any kind of data.") doesn't mean  
"any kind of data," it means various "multimedia" kinds of data --  
but not Rev objects?

Since the rest of the data I need to send to each instance of the  
dialog will be stored in an array built from custom properties --  
that seems to be the Rev-"native" way to do it -- it feels peculiar  
to have to call up a different data stream for the operation. I  
suppose I'm just being fussy.

I wonder if this limitation (if I understand it correctly) gets in  
anyone else's way?

Charles

On Aug 1, 2005, at 12:06 PM, Ken Ray wrote:

> On 8/1/05 7:44 AM, "Charles Hartman" <[hidden email]>  
> wrote:
>
>
>> This has got to be simple, but I'm stuck: how do I get a group into a
>> custom property? I don't even need to do it from a script; the msg
>> box or Inspector will do.
>>
>> The group includes an image and a bunch of little fields. I want them
>> in a cust prop because I'll have a lot of them and I want to automate
>> sending them to a dialog box.
>>
>
> How about just creating the group in an offscreen stack (or  
> substack) and
> then doing "copy group <groupDesc> to <targetLoc>" every time you  
> want an
> "instance" of the group?
>
> Otherwise, you can't really store a true group object inside a custom
> property AFAIK - you could store the binary of a stack with one  
> card that
> only had your group on it, or you could store the specifications of  
> all the
> objects that make up the group and then build it from scratch each  
> time
> based on the specifications for each object.
>
> But personally, I'd suggest the "copy group" approach...
>
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: simple custom property question

Ken Ray
In reply to this post by Charles Hartman
On 8/1/05 12:48 PM, "Charles Hartman" <[hidden email]> wrote:

> So "any kind of data" (as in, "You can define custom properties for
> any object, and use them to store any kind of data.") doesn't mean
> "any kind of data," it means various "multimedia" kinds of data --
> but not Rev objects?

Actually the problem is that there isn't a way to "get" the binary of a
specific object in Rev... so you can store regular variable data, plus any
binary file that you can read from disk. So since there's no way to directly
dump a group to disk, the only thing that can be done is to dump the stack
that *contains* the group to disk - but that's not what you want.
 
> Since the rest of the data I need to send to each instance of the
> dialog will be stored in an array built from custom properties --
> that seems to be the Rev-"native" way to do it -- it feels peculiar
> to have to call up a different data stream for the operation. I
> suppose I'm just being fussy.

I'm curious... why won't "copy group" solve your problem? That's currently
the Rev-native way to do this kind of stuff (unless I'm not understanding
correctly what you're trying to do).

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: [hidden email]


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: simple custom property question

Charles Hartman

On Aug 1, 2005, at 2:06 PM, Ken Ray wrote:

>
> I'm curious... why won't "copy group" solve your problem? That's  
> currently
> the Rev-native way to do this kind of stuff (unless I'm not  
> understanding
> correctly what you're trying to do).

It probably will. It just doesn't feel as tidy as if I could put it,  
with the rest of the data I need to send to the dialog, into a custom  
property. Anything with two stages constitutes a strain on my brain :).

(The situation, if you're curious, is this: I have a dozen or so  
"Additional Exercises" cards in a stack which is a tutorial on  
scanning metrical verse. Each card displays a poem, which is image  
that began as as a screenshot; over each line of the poem is an  
opague borderless field hiding the scansion marks above the line, and  
a transparent borderless button. When the user clicks the button, a  
complicated dialog box will come up. It will show a [screenshot of  
the] line, with individual "hiding" fields over each of its scansion  
marks. The user will click on syllables that are stressed, and the  
stress marks will appear. When that's done, the user will click a Go  
On to get to another card, in which the same line is shown, now with  
stress and slack marks revealed over every syllable, but the foot-
division marks still hidden; below that, a set of check boxes, one  
per foot, and a set of radio buttons with the names of possible feet.  
Data in a custom property in the poem's card will list the feet for  
each line, and possibly the number of stressed syllables. My idea was  
to send to the dialog, when the user calls it up by clicking on any  
line, a packet of data giving the "correct" answers to the foot  
questions; but the dialog also needs, as data, the [screenshot of  
the] line and its marks, and the little fields that hide the marks  
until the right mouse clicks. I guess I can just send the dialog  
those two different kinds of data in two operations -- it just  
doesn't feel quite as efficient as sending it all at once. It means  
that a copy of each line's screenshot, in a group with all its little  
hiding fields, needs to be stored somewhere elese -- most simply, I  
guess, invisibly on the card itself. Hope any of this makes any  
sense. I'm not sure it does to me, any more.)

Charles


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: simple custom property question

Stephen Barncard
In reply to this post by Ken Ray
  I've been experimenting successfully with obtaining all properties
of an object and storing them in a custom property, then later
recreating the object from the property on the fly.

I would imagine it gets more complicated with groups - I haven't done
this yet - but then the whole group could be stored in a custom
property set! A group would also have to have other properties
included besides the built in ones, such as scripts and positions of
the objects contained within the group. One could probably store
these as properties of the group itself. The group would be the
'first out' for parsing, and other params needed could be pulled from
it.

Groups within groups would necessitate some recursive code, and more
complexity. But that is often rare unless one wants to deconstruct
and reconstruct a complete stack in this manner!!

But Ken is totally right - 'copy group' is a lot easier!

sqb


>Otherwise, you can't really store a true group object inside a custom
>property AFAIK - you could store the binary of a stack with one card that
>only had your group on it, or you could store the specifications of all the
>objects that make up the group and then build it from scratch each time
>based on the specifications for each object.
>But personally, I'd suggest the "copy group" approach...
>Ken Ray
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: simple custom property question

Richard Gaskin
Stephen Barncard wrote:
> But Ken is totally right - 'copy group' is a lot easier!

And lightning fast. I have some complex dynamic layouts in which I found
it simpler to have the UI built on the fly from copied groups than to
make them all by hand -- never notice the difference, with a dozen
groups copied in just a few milliseconds.

--
  Richard Gaskin
  Managing Editor, revJournal
  _______________________________________________________
  Rev tips, tutorials and more: http://www.revJournal.com
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: simple custom property question

Charles Hartman
In reply to this post by Ken Ray
OK, I believe you. But I'm missing something really simple about how  
to do it. (I haven't used this syntax before.) If the group is on one  
card in my main stack (with its Visible set false), and in the script  
of a button on the same card I open a substack and try to copy the  
group to it, I get an error. If I say

     copy myGroup to stack mySubstack

the error is "can't find object"; if I say

     copy group myGrouop myGroup to stack mySubstack

the error is "can't find background". What basic fact(s) am I  
forgetting?

Thanks for any available hand-holding. The Doc write-up on groups and  
backgrounds is obviously relevant, but I can't parse an answer to  
this question out of it.

Charlesd


On Aug 1, 2005, at 12:06 PM, Ken Ray wrote:

> How about just creating the group in an offscreen stack (or  
> substack) and
> then doing "copy group <groupDesc> to <targetLoc>" every time you  
> want an
> "instance" of the group?
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: simple custom property question

Brian Yennie
Charles,

I believe the problem you are having is that you are going to the
substack and then using a short reference to the group, which of course
does not exist yet in the substack.

I think you want one of these methods. I don't know if one of them is
preferable to the other, but hopefully illustrative of the issue.
Basically, you either need to give the long name of the group object,
or else point Revolution to what stack it should use for interpreting
the short name.

1) Use a long name for the group

open stack "mySubstack"
copy group "myGroup" of card 1 of stack "myMainstack" to stack
"mySubstack"

2) Use the defaultStack property

open stack "mySubstack"
set the defaultStack to "myMainStack"
copy group "myGroup" to stack "mySubstack"

> OK, I believe you. But I'm missing something really simple about how
> to do it. (I haven't used this syntax before.) If the group is on one
> card in my main stack (with its Visible set false), and in the script
> of a button on the same card I open a substack and try to copy the
> group to it, I get an error. If I say
>
>     copy myGroup to stack mySubstack
>
> the error is "can't find object"; if I say
>
>     copy group myGrouop myGroup to stack mySubstack
>
> the error is "can't find background". What basic fact(s) am I
> forgetting?
>
> Thanks for any available hand-holding. The Doc write-up on groups and
> backgrounds is obviously relevant, but I can't parse an answer to this
> question out of it.
>
> Charlesd
>
>
> On Aug 1, 2005, at 12:06 PM, Ken Ray wrote:
>
>> How about just creating the group in an offscreen stack (or substack)
>> and
>> then doing "copy group <groupDesc> to <targetLoc>" every time you
>> want an
>> "instance" of the group?
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: simple custom property question

Charles Hartman
Woops. Now _that's_ embarrassing. Thanks, Brian.

Charles


On Aug 1, 2005, at 9:08 PM, Brian Yennie wrote:

> I believe the problem you are having is that you are going to the  
> substack and then using a short reference to the group, which of  
> course does not exist yet in the substack.
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: simple custom property question

Brian Yennie
Bah. I think it actually is a bit of an unusual situation- when copying
from one stack to another, how SHOULD you approach your object
references? What stacks should be open and to where?

The error message led me to what was wrong, but I'd bet this one fails
for a lot of people at first pass.

> Woops. Now _that's_ embarrassing. Thanks, Brian.
>
> Charles
>
>
> On Aug 1, 2005, at 9:08 PM, Brian Yennie wrote:
>
>> I believe the problem you are having is that you are going to the
>> substack and then using a short reference to the group, which of
>> course does not exist yet in the substack.
>>
>
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: simple custom property question

Richard Gaskin
Brian Yennie wrote:
> Bah. I think it actually is a bit of an unusual situation- when copying
> from one stack to another, how SHOULD you approach your object
> references?

After a create, clone, or copy command the local variable "it" contains
the long ID of the new object.

So you can keep your focus on the stack containing your template group
objects, referring to them by short name, and the long ID returned in
"it" will help you if you need to do anything else in the newly copied
group:

on CopyObjects
   set the defaultStack to "MyTemplateObjects"
   copy grp "MyThang" to stack "Whatever"
   set the loc of it to 100,100
   copy grp "MyOtherThang" to stack "Whatever"
   set the loc of it to 100,400
end CopyObjects


--
  Richard Gaskin
  Managing Editor, revJournal
  _______________________________________________________
  Rev tips, tutorials and more: http://www.revJournal.com
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: simple custom property question

Charles Hartman
In reply to this post by Brian Yennie
One more question (for now!) about this operation: how do I get rid  
of it? In testing, I've opened the substack half a dozen times -- and  
there are half a dozen copies of the group in the substack. Obviously  
I've got to dump 'em somehow (in a script when the stack closes?),  
but how? They're there under the original name, from the main stack  
-- if I delete the group, will it get deleted in the main stack too?

Confused!

Charles



On Aug 1, 2005, at 9:21 PM, Brian Yennie wrote:

> Bah. I think it actually is a bit of an unusual situation- when  
> copying from one stack to another, how SHOULD you approach your  
> object references? What stacks should be open and to where?
>
> The error message led me to what was wrong, but I'd bet this one  
> fails for a lot of people at first pass.
>
>
>> Woops. Now _that's_ embarrassing. Thanks, Brian.
>>
>> Charles
>>
>>
>> On Aug 1, 2005, at 9:08 PM, Brian Yennie wrote:
>>
>>
>>> I believe the problem you are having is that you are going to the  
>>> substack and then using a short reference to the group, which of  
>>> course does not exist yet in the substack.
>>>
>>>
>>
>> _______________________________________________
>> use-revolution mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your  
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>>
>>
>
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: simple custom property question

Ken Ray
On 8/1/05 10:03 PM, "Charles Hartman" <[hidden email]> wrote:

> One more question (for now!) about this operation: how do I get rid
> of it? In testing, I've opened the substack half a dozen times -- and
> there are half a dozen copies of the group in the substack. Obviously
> I've got to dump 'em somehow (in a script when the stack closes?),
> but how? They're there under the original name, from the main stack
> -- if I delete the group, will it get deleted in the main stack too?

No, those are copies... you just need to be specific, as in:

  delete group "MyGroup" of stack "MySubStack"

If you just say:

  delete group "MyGroup"

it isn't specific enough and the interpreter will try to find the group
"MyGroup" on the topstack, which means that if your main stack *is* the
topstack, you end up deleting the "original". If your substack is the
topstack, it will delete it from the substack. Better to make in
non-ambiguous and specify the full path to the group.

BTW:, I'd recommend renaming the groups as soon as they are copied. One of
the nice things is that the "it" variable contains the long ID to the newly
created or copied group. So you can do this:

  copy group "MyTemplateGroup" of stack "MyMainStack" to stack "mySubStack"
  set the name of it to "Copy 1"
  copy group "MyTemplateGroup" of stack "MyMainStack" to stack "mySubStack"
  set the name of it to "Copy 2"

So you'd have two copies of the group on the substack, one neamed Copy 1 and
the other named Copy 2.

HTH,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: [hidden email]


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution