loadSection(newArea,newSubsection)
{
Queue.addEvent({fn:fadeOffSubsection, section:_currentSubsection});
Queue.addEvent({fn:unloadSubsection, section:_currentSubsection});
Queue.addEvent({fn:fadeOffArea, area:_currentArea})
Queue.addEvent({fn:fadeOnArea, area: newArea});
Queue.addEvent({fn:loadSubsection, section:newSubsection});
Queue.addEvent({fn:fadeOnSubsection,section:newSubsection});
}
// =============
say current status is [area="kitchen",subsection="products"]
loadSection("home","recycled");
fadeOffSubsection products
unloadSubsection products
fadeOffArea kitchen
fadeOnArea home
<== loadSection("kitchen","info"); // what happens if i interrupt here *
loadSubsection recycled
fadeOnSubsection recycled
* should run like this
fadeOffArea home
fadeOn area kitchen
loadSubsection info
fadeOnSubsection info
(ie it skips the first 2 operations because there's no subsection loaded)
(but the queue is wholly replaced with this new one)
// ==========