Stack structure, media and memory?

Klaus Major klaus at major-k.de
Fri Feb 17 04:31:29 EST 2006


Hi Ken,

> Hi all
>
> I'm seeking advice on stack structure, for a template for a
> presentation-type standalone. I'm using R2.7 trial.
>
> The (proposed) app will have a main menu, but I'd like a separate  
> navigation
> menu, maybe a stack menu with a series of pulldown menu buttons for
> navigation (Section 1, page x... etc).
>
> Content will be contained in other stacks (or substacks?).  Each  
> stack card
> will need to load a large image or a movie (from external  
> directory), and
> there would be lots of cards.  The cards will also contain text,  
> buttons,
> drawn objects, animations etc. Text and vector graphics would be  
> done in
> Rev.
>
> However, I can't find info on what exactly happens to loaded media  
> when a
> card (or substack) is closed, in terms of memory purging.  I've had  
> other
> stand alone media-heavy apps hang because of memory overload so  
> it's an
> issue for me.

All media on a card or in a stack are only loaded when needed and  
unloaded
when you leave the card they were on.

This is because the "alwaysbuffer" of players and images is set to  
"false" by default.
And the "bufferhiddenimages" is also set to "false" by default.

Check the documentation for an exact definition of these properties.

> The Rev pdf manual says <If one stack in a stack file is loaded  
> into memory,
> so are any other stacks in the same stack file. You cannot load one  
> stack in
> a stack file without loading all the rest at the same time even if  
> you open
> only one of the stacks.>
>
> Questions  (these refer to the behaviour of a standalone app):
>
> 1. Am I right to interpret the above quote to mean a stack file  
> includes any
> substacks, and these are all are loaded when the main stack is ?

Yes.

> 2.  It isn't possible to purge a substack from memory using  
> destroyStack,
> even if the substack is closed and another opened ?

Yes (but I am not 100% sure) it is not possible.
This is only possible with separate stacks (files).

> 3.  So, to purge a stack from memory when it's closed, I would need  
> to use
> separate main stacks for each section ?

Yes.

> 4.  So, if it is necessary to use a series of separate stacks,  
> these will
> not be bundled together into a single file when the standalone is  
> built?

Exactly.

Hope that helps :-)

> Ken

Regards

Klaus Major
klaus at major-k.de
http://www.major-k.de




More information about the use-livecode mailing list