Skip to content

Closing In on the Date

There’s a better and a worse way to move an event closer to the right date, when you don’t know the date at first, and you can only estimate a wide time range for it, a range with the right date inside it somewhere.

Here’s an example.  You have a picture of Robin rowing.

Summer of a certain year, you know, so you enter “Robin rowing” on the Robin band (blue) inside a range from early May to late September of that year (the dark vertical lines):

You’ll add the picture at some point, and you’ll see a thumbnail of the picture in the empty box above.

Who’s that with her in the boat?  Robert.  You give Robert a band of his own, in green, but you have no clues about him this far back.

Then you find a letter from Robert’s mother thanking Robin’s mother for keeping Robert at their lake house for a week while her father was in the hospital.  You put “Robert arrives” on the green band.  You know the week and day.

That’s a clue to the date of the picture of Robin rowing.

You edit the time ranges  and select the time range around “Robin rowing,” which is then outlined in red:

Now you have two ways to move “Robin rowing” towards “Robert Arrives”.

You can move “Robin rowing” to the left inside its time range, from 50% to 40% or whatever, where the percent says how far into the time range you want the event to appear.

That’s not the best way.

The best way is to narrow the time range around “Robin rowing”:

Drag the right and left edges of the time range (in red) closer to “Robert arrives”.  This is the time range for “Robin rowing” on the blue band, so now you know the date of this picture to within a week.  A clue on the green band gave you a better date on the blue band.

You want to narrow all these time ranges towards exact dates, or as nearly as you can.

Use the percent where you have more than one event in a time range.  Use the percent to space out the events so they don’t crowd and hide one another as you narrow their time range.

===

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Categories: uses.

Update

Update to the software on 18 July (Sunday).

Edit time ranges using drag-and-drop.

These buttons from right to left:


  • return to default zoom level

  • zoom out to show more events across more time

  • zoom in

  • edit bands, add bands, move events from one band to another

  • edit time ranges, add time ranges, move events from one time range to another

  • return to full chart view

    Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

    Categories: tech.

    Before WhoWhereWhen

    I looked for this software and when I couldn’t find it, I built it.

    What told me I needed this software? How did I do this before WhoWhereWhen? Why wasn’t that good enough? What else did I need?

    I needed this for court.

    Before WhoWhereWhen I kept one document I called Timeline (it could have been a spreadsheet, but it was a text document, not Word but a Google text document). It looked like this:

    2010
    (at start, married 10 years 8 months, Eva age 10 years 3 months)
    15Jan2010 book launch Seth Godin Linchpin with Joel; see Kat James The Truth of Beauty
    09Feb2009 met with Don B
    23Mar2009 Wilbert the Whale
    16May2009 wedding Colleen

    Important dates that would be hard to look up later, that is.  One line each, with date first and note after, so all the dates line up one below another for fast scanning.

    Notice under the year 2010 I wrote:

    (at start, married 10 years 8 months, Eva age 10 years 3 months)

    I was forever calculating how long and how old.  How long had I been married at that point.  How old was my daughter at that point?  I did each calculation two or three times, because it’s easy to get wrong.   This note at the start of each year warned me if I was way off.

    I needed automatic How Old? and How Long?  Instantly, with certainty.

    The other problem: Kat James is an old girlfriend who has a new book, Don B is a new client, the wedding is for my sister’s youngest in another state, and Wilbert the Whale is a song from my daughter’s farewell-to-elementary concert.

    It’s a jumble.  All mixed together: His business, her business, dating, family, daughter, stepkids, son away at college in another state….

    I need automatic How Old? and How Long? on each of those.

    How long have I had this client?

    How long since I last saw that girlfriend?  How long since her book came out?  How old is she now?

    How old is my sister’s youngest?  How long since I went to her high school graduation?  How close is my sister to retirement?

    How long were we in that house?  How long did I have that apartment in the city?  How long for both, before I sold the apartment.  How long between selling the apartment and buying the business for my new wife?

    Like that.

    With answers like that, I was quick on the draw in court, and the other side looked untrustworthy for not having these answers, or guessing and getting them wrong.

    Sure, I needed a way to display selected data in the courtroom.  That’s the easy part.  You can find lots of timeline programs to do that.  The court didn’t need to know about my old girlfriend or her new book, so I needed to separate things, and only show what pertained.

    I needed bands, parallel timelines for each thing, the girlfriend, her book, the client, my business, the house, the apartment, the business for my wife, my son, my daughter, my marriage, my stepkids….  Each Who or What or Where.

    I needed to see those separate timelines in parallel, together but separate.  On parallel tinted bands.

    I needed an automatic How Old? or How Long? on every band, instantly, for each Who or What or Where.

    Then I could jump from band to band: How old was my daughter when we closed that business?

    But I had more questions than answers, and I needed a way to put a question on the timeline, on its own band, before I knew the dates and answers.  I needed the timeline tool to take me from question to answer, help me arrive at the right dates.  I needed a way to get closer and closer answers as I went along.

    For example, we closed that business just before we went to my son’s graduation from high school in another state.  My daughter went with me.  One of the last times she rode in a car seat, so she could see out the window.  The graduation date on one band gives me the business closing date on another band.

    Some dates I never know exactly, but I get close.  I get the time range down to five or ten days, and then the day of week (it was a Sunday, say) takes me the rest of the way.

    In my text timeline, before I built the WhoWhereWhen software, I started making bands.  At the bottom I collected dates about my son, or about my business, or about the court case.  I made a separate heading for each at the bottom, and copied dates from the main timeline to the heading.  When I had a loose idea of the date at first and then a better idea of the date later, I had to fix the date in both places.

    And when I tightened my answer about some date, I needed to tighten related dates on other bands.  For example, when did my son graduate high school?  May or June of 2007.  That’s a two-month range at the beginning.  When I got  closer to the date, I had to fix it in two places, then go to other dates with the new clue.  The business closing date, for example.  Also in two places, the main timeline and the separate business timeline at the bottom.

    I got winning answers this way, powerful ammunition in court, but so much work, and so much still to do with court deadlines coming.  In court you get one chance and it won’t matter if you find God’s own truth a week too late….

    So I built the WhoWhereWhen software.  A better future from a better knowledge of the past.

    ===

    Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

    Categories: uses.

    Dragnet

    Dragnet.

    Look at this face.  Joe Friday of Dragnet.  The world-weary detective has seen it all, more than most of us could stomach.  Pained, and still faintly disgusted, he chooses his battles with care, and sidesteps the rest.

    I was thinking of Dragnet as a name for this WhoWhereWhen software.  Your net may drag up more than you were looking for.  I have seen it happen, for one of our early users.  I have seen that Joe Friday look on his face.

    Dragnet was an early forensics show, giving details of police work and detective methodology in the radio and early TV era.

    The term “dragnet” is a police term taken  from fishing.  Not sport fishing or solitary fishing, but a team effort by the men of a village, a tug-of-war that drags a huge net through the shallows and onto shore with hundreds of fish inside.

    So in detective work, a dragnet is a way of searching for a suspect with every member of the force pulling together, not the hit-or-miss efforts of a detective or two over time.  The dragnet surrounds a hidden suspect who might flee, and closes off all routes of escape.  Then the dragnet slowly tightens, closing in on the hidden suspect from all directions.

    Like a dragnet, WhoWhereWhen weaves a net around your questions, hunches, and suspicions, a net of horizontal strands and vertical strands, with various Who and What and Where on the horizontal bands (Edna, the cabin, the skiff), and time ranges on the vertical (“When was Edna at the cabin when  we had that skiff there?  Not sure.  Between Spring of 1998 and Autumn of 1999, I know that much.”

    In this dragnet, only the vertical tightens, the time range, as you close in on the exact dates of something or other (“Ah, we got the skiff last week of September, an end-of-season sale, just before we closed the cabin for the season, but which year? Edna went to Spain for two years in January 1999, so it was 1998, the last of September in 1998….”

    WhoWhereWhen is forensic software, investigative software, and I have seen that Joe Friday look from one of our earliest users.

    Joe, let’s call him.  Joe used WhoWhereWhen to prepare for court when his wife sued for divorce.  Second marriage for both of them.  When did he lose her, he wondered, in the course of their ten-year marriage.

    In the beginning he sold his apartment in the city for a gain of 350 thousand and moved in with her, an hour outside the city.

    He entered that into WhoWhereWhen, with links to documents that gave the dates and details.  She had two kids at home, an older girl and a younger boy, not yet in high school.

    He entered that into WhoWhereWhen, with his wife on one band, the boy on another, and the girl on another.

    He bought two gym locations for her to operate and she was so happy for a time.

    He entered that into WhoWhereWhen, with two new bands for the two locations, and links to receipts and letters and such, that gave the dates.

    The gyms were a bad investment and failed, for everyone.  Was that it, he wondered?  When was that?  Early 2005.

    He entered that into WhoWhereWhen….

    Yes, she had been shrieking horrible things around that time.  Shocked, and wondering if she needed help of some kind, he had written some of them down.  She was a psychiatric nurse, though.  She would know for herself, wouldn’t she?

    He entered that into WhoWhereWhen….

    Were her two kids still at home to hear that?  He looked.  No, they moved in with their father in a neighboring state the summer before.

    He entered that into WhoWhereWhen, approximately for now….

    His wife took that hard, when her two kids moved in with their father.  She blamed Joe, though Joe had heard that plan from the time he first met her kids and their father.  It was their dream to go to school in that wealthy state, if and when their father could afford it.  Their father and mother had gone bankrupt and nearly lost the house before Joe arrived.  Joe brought the mortgage current and made major and long-overdue repairs to the house.

    He entered receipts and dates into WhoWhereWhen….

    Joe removed two illegal renters from the home and paid a fine.  Then he renovated those spaces.  Their living space doubled.

    He entered court citations and receipts and dates into WhoWhereWhen….

    His wife had twice lost her job just before they married.  No fault of hers, but the companies failed.  Her job was life and death to her daughter, though.  Her daughter had survived a major birth defect and needed expensive medicines every month and expensive surgeries every year as long as she stayed alive.  Joe supplied health insurance and paid for a surgeon the insurance would not cover.

    When was that surgery?  Joe entered that into WhoWhereWhen, with his best guess about the date range.

    The daughter (Amy, let’s say) had just reached puberty.  How old?  She had a tutor while she recovered at home for six weeks, a tutor from the high school.

    Joe tightened the date range around that surgery.

    It was her freshman year, 2001-2002.  Early in the year, because she was afraid of falling behind for months to come.  Not quite two years, then, after Joe married her mother.

    Joe stared at the picture in WhoWhereWhen.  The net had begun to tighten around something.  Something was swimming into view.  Joe felt sick.

    His new wife had told him F- Y- in slow motion, in an exorcist voice, early in their marriage.  When was that?

    Joe entered that into WhoWhereWhen as a question, with a huge date range around it, to start with.

    That was after a Christmas pageant.  He had sent her troubled son to a special school for a year.  A year at the school cost more than Joe’s car.  His last year before high school.  The year of his sister’s surgery.

    They had just come out of the Christmas pageant on campus.Within a few weeks after that surgery, then.  Joe tightened that time range in WhoWhereWhen.

    Her son had sung in the pageant that night.  They had just gotten to the car afterwards.  In the dark, waiting for other cars to move, Joe said he liked the pageant and the people, and the way their skits made Christmas funny.  His wife leaned close to his ear and opened her teeth as wide as they would go and groaned F- Y- into his ear, in slow motion.  He had a sick feeling then, and a sick feeling now, entering it into WhoWhereWhen.  Like seeing the  girl’s head turn all the way around in the Exorcist, or her words come out in bass baritone, with frost on her breath.

    What was that, he asked her, when he saw she was not joking.  He asked then and got no answer.  He asked many times later.  She gave a different half-hearted explanation each time.  Maybe, Joe thought, someone had offended her that night.  They were snooty at that school, as she put it.  Not her kind of people.

    Her strange unhappiness had begun long before their businesses failed. WhoWhereWhen gave Joe the age of the boy at any point, and the age of the girl, and the age of the marriage, and the age of the businesses, each on its own band.

    They had just started their first location at the time, and customers saw the sign that said Coming Soon, and wrote letters asking where they could send their money.

    She was shrieking at him long before the businesses failed, when the businesses were booming.  The weave of WhoWhereWhen was tightening around something, and Joe began to make out the shape.

    Their father came to the Christmas pageant that night.  Maybe he said something to upset Joe’s wife.  About the kids going to a different school in a different state, maybe.  That old plan was no longer just talk.   Their father had begun to put that plan in motion.  Was that what upset Joe’s wife?  That night and from then on?

    He saw it now.

    She had married Joe to keep her kids from leaving, from going with their father.  Their father had recently remarried.  If he remarried, she could compete with that.  She could remarry too.

    When her kids left anyhow, she was ready to leave too.  Leave Joe.

    She had married him for her daughter’s medicine and surgery.  She had never loved him.

    Joe tried to see it another way, but he was stuck.  Caught in his own net.

    Now you know what’s behind that look on Joe Friday’s face.  The dragnet dredges up things no one wants to see….

    ===

    Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

    Categories: uses.

    Dragnet Again

    One more thought about Dragnet.

    In a Dragnet episode, Joe Friday is piecing together a story that has already happened.  A crime, usually.  We follow him as he tries find out what happened.  We get  the story of Joe Friday finding out the story of some perp.  The story of getting the story.  The story of the story coming to light.  At the start of the episode, one story has already happened, the other is just beginning.

    You could work out either story in WhoWhereWhen.  You could plan Joe Friday’s story before it happens.  Storyboard it.  Now you’re putting the future into WhoWhereWhen.  Things that have not happened yet.

    We told how someone used WhoWhereWhen in his divorce case.  He was a Joe Friday, turning here and there to find out what had happened, what had gone wrong.  His research was a story too.  The story of an investigation, a mystery to solve.

    If you had to tell what he found, and how he found it,  you could lay out his steps in WhoWhereWhen.  Storyboard it, as they say.

    And beyond that, use WhoWhereWhen as a planning tool.  Plan your research.  Plan your investigation.  Plan your reporting.  You put in future events as tasks, with your best idea of when you will get to them.  As that future gets closer, your estimates get closer.

    This is WhoWhereWhen as a Gantt chart.  A project plan.  Who does what when, if it’s all to add up at the end.

    WhoWhereWhen for investigation.  WhoWhereWhen for storyboarding.   WhoWhereWhen for project planning….

    ===

    Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

    Categories: uses.

    Truth Scales?

    Just tell the truth.  It’s easier to remember.

    How many times have we heard that?

    I heard it again in this video by Y Combinator founder Paul Graham.

    By the way, send this link to the high school English teacher who told you not to say Ummm or Uhhhh during a book report.  This guy is almost singing Ummm and Uhhhh.  Singing a duet, one guy giving the official line, in words, and an evil twin mocking him with Ummmm and Uhhhhh….  Does Paul Graham know that?  You bet.  This talk is a two-for-one…

    Truth is stateless, he says, and ulterior motives don’t scale.  That’s how they talk on Planet Lisp.  He made his fame and fortune building a web-building tool in Lisp, and here he’s talking to Internet start-ups.

    The trouble with lying is you have to remember too much, he says.  You have to remember everything you’ve said in the past in order not to contradict yourself.

    True.  I have been in a year-long court contest for custody of my daughter, who is now ten.  The court, I have learned, is looking for falsity, not truth.  The first party to go over the falsity limit loses.  So if you tell the truth more than once, or dozens of times, the other side will look for falsity in every difference.  That’s an old trick among lawyers.  Make the other side tell their story over and over, and pry apart any difference between one telling and another.

    I think Graham is wrong though, in one way.  The truth is no easier to remember than lies.  Or I would not have needed this WhoWhereWhen software so badly.  I put this last year of the trial into WhoWhereWhen, and I put my ten year marriage into it.  I should know this already, right, because I was there, and this was my life?

    Nope, don’t count on it.

    I remember a question from the judge on the first day.  Why did you do such-and-such?  What were you thinking?

    I gave a good answer, I thought.

    But later, when I looked at that day and that week with WhoWhereWhen, I slapped my forehead.  Of course!  No wonder!  Who wouldn’t?!  I have a much better answer today than I did a year ago, when all of this was much more recent to me.

    You are a stranger now to the person you were then.  The other side can know your history better than you do.  That’s murder in court.  But if you do your homework, you can know your history and theirs better than they do.  That’s what I built WhoWhereWhen for.  First I looked for it, but when I couldn’t find it, I built it.  The stakes have never been higher for me.

    We’ll hold for another time what Diane Loftus has discovered about memory in and out of the courtroom.  Meanwhile try this.  Think of a camel.  Are you remembering that camel, or imagining it?   What’s the use of that question?  Why do we have two words for this, remember and imagine?  What’s the difference?

    ===

    Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

    Categories: uses.

    Easier for You, Harder for Me (Tech Note)

    This is the tech note, for software builders.

    Timeline builders, see Easier for You, Harder for Me.

    You can just drag an event from one band to another.  The square bubble is some event on the timeline you are making.  Robin’s surgery, for example, or Robert enters a new school.  Here you decided to put Robin events on one band and Robert events on another.

    Event To Another Band (Before)

    These changes have to be fast and easy.  This is a research tool.  You could have hundreds of events on dozens of bands.   In the beginning, you don’t know exactly where most of those events go, timewise.  You put them in a likely time range, and later you narrow that time range to get closer to a particular date.  One event gives you clues about another.  One band gives you clues about another.  You nudge all these things around, up and down, left and right, larger and smaller…

    Building that, I learned a hard lesson about drag and drop.  I want to hold the date of your event steady while you drag it up or down to another band.   You can drag up or down but not side to side (not for this, anyhow).

    Behind the scenes that’s done in the event MouseMove.  I let Y change (vertical) but not X (horizontal).

    OK, two kinds of event here.  We need different names.  Let’s say “life event” or square bubble for the one that’s visible on the timeline, and “mouse event”  for the ones known only to software builders, inside the software.

    Inside that square bubble (your life event), I watch for the MouseDown event, which tells me you want to drag that bubble to another band.

    Inside the band I watch for the event DragEnter and DragDrop and so on, telling me which band you want.

    Where do I watch for MouseMove, to hold the square bubble to a vertical line while you drag it?   Inside that bubble, I thought.  Same place where I watched for MouseDown.  Wrong!

    The drag and drop did some strange things, none of them good, until I found the problem with this.  Actually, I found the answer in the book Advanced Flex 3 (by Tiwari and others, published by Friends of Ed).

    It’s one of those split-second timing problems.  You move the mouse faster than Flex can move the square bubble along behind you.  Once your mouse gets ahead of the square bubble, the square bubble no longer gets those MouseMove events, and it stops following your mouse, like a little brother who goes back home if his big sister runs down the block too fast for him.

    Where else would you watch for MouseMove?  Not on the bands.  You drag across various bands along the way.  Which one of those bands could steer the drag motion straight from end to end?

    Only the chart as a whole, with all the square bubbles and all the bands, gets all the MouseMove events wherever they may go.  So at MouseDown, at the start of the drag motion, the bubble asks the chart to steer.

    At MouseDown, the bubble calls a steerDrag method in the chart, and passes a reference to itself and the X number that should stay the same throughout.  The charts sets an event listener for MouseMove and MouseUp.  As each MouseMove event arrives, steerDrag resets X on the bubble, so Y (the vertical) can change but X (the horizontal) cannot.  At MouseUp the chart removes both event listeners and steps out of the loop until next time.

    The steerDrag method is more useful than that.  It can hold the drag motion to a horizontal line instead, when that’s what you need, or steer a band vertically, when you want the bands in a different order, or, best of all, move and resize your time ranges horizontally, as you work your way closer and closer to exact dates.

    ===

    Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

    Categories: tech.

    Easier for You, Harder for Me

    First,  a note for users, then a tech note.

    You are preparing for a court appearance.  Cases are won before you step into the courtroom, your attorney tells you, by the quality of your preparations.

    Your ex-husband paid $16k for to send your son (his stepson) to a private school at a difficult time in the boy’s life.  He paid $19k for a surgery your daughter (his stepdaughter) needed, but insurance would not cover.

    You know the date of the surgery, within about a two week range.  But while working on that, you got the bands backwards.  You put her surgery on his band (Robert), and his tuition on her band (Robin).

    Event To Another Band (Before)

    Easy.  You drag the first event, her surgery, down to her band, and drag his tuition to the band above.

    Event To Another Band (After)

    Nothing else changes.  The dates and description and linked documentation stay the same for both events.  Only the band changes.  Now when you want just his events or hers, but not both, you select the band…

    ===

    Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

    Categories: uses.

    stateGroups: compound states in Flex 4

    Yes, this is a tech note.

    Two ways to come at this.  We can start with the feature in the language, and explain how to use it, or we can start with a developer’s problem, and use the language feature to solve it.  How about both?

    First, the language feature.

    States are done differently in the new Flex 4.  Better, say many developers in their comments.  I agree, from what I can see.  But I was puzzled by stateGroups (some way to combine states?) until I built some experiments.  I was not alone in feeling puzzled, I find.

    Second, a developer’s problem where stateGroups help.

    Suppose you need three variations of the same input form.  Call them FormA, FormB, and FormC.  FormA is for editing a thingy (an event, in this example).  FormB is for adding a new one.  FormC is another way of adding a new one.  In FormB we add a new event and select a time range for it.  In FormC we add a new event and also add a new time range for it.

    We could make three different forms, copying and pasting from one to the next, but in time we would make three times the work for ourselves when we needed to make a change.   Or we could master the stateGroups feature, and see if switching states could switch one variation of the form to another.

    Here’s where you decide what kind of developer you are.

    Option One: You know how to copy and paste.  You can do it in your sleep.  Though it may be more work, now and later, it’s easier work.  In Option One you choose more work of an easier kind.  More work, easier work.

    Option Two: You suspect the new language feature stateGroups could solve this problem, but you aren’t sure.  You read documentation about stateGroups and look for examples from other developers.  The documentation only adds another layer of mystery.  The examples from other developers (not many, yet, for this new feature) all differ wildly from one another.  These developers are groping at the question.

    So to use stateGroups, or just to see if stateGroups could be useful for this problem, you will have to build an experiment or two.  If you build your early experiments well, you won’t need as many.  You build the experiment to ask the question this feature answers, or your best guess at what question this feature answers.  Your first guesses may be wrong.  No, that’s not the question this feature answers, you find.  Or you didn’t ask the question right, and the witness gave a mysterious answer you cannot use.  You try again.  Meanwhile your development project is at a standstill, and you are building things you will throw away.

    This is where you decide what kind of developer you are, as I said before.  Here’s where you choose your destiny, Hornblower.

    You are choosing to work harder or work smarter.   Option One, copy and paste, is more work, but you already know how to do that kind of work.  Option Two is harder.  You must try something new and puzzling.  It may save you work and speed up your work, soon and into the future.  First though it could make you look and feel incompetent and unproductive, like maybe you don’t belong in the world of developers.

    Suppose this wasn’t your choice.  Someone above you would make the choice and tell you.  Now the question is different.  Do you want someone assigning you to easier kinds of work, older kinds of work, work that everyone has known for a long time?  And telling you to work harder and longer and more, because this should be easy, if you just give it enough hours?

    So while the choice is yours, and no one else will tell you what to do, what do you choose?

    Here’s what I found with the experiments I built.

    FormA edits an event.  Notice the first two buttons say Update and Delete.

    FormB is similar, but FormB adds a new event instead of editing one.  Notice those two buttons now say Clear and Add in place of Update and Delete.  We also have a new input at the bottom, a dropdown list that selects When.

    FormC differs in just one way.  That last input for When now takes a date, not a selection from a dropdown list.  Where FormB selected a time range for the new event, FormC adds a new time range for it.

    So, is that three states?  Edit, Add One, and Add Both, maybe?  But much of the form stays the same from state to state.  We don’t want to slide back into copy and paste after all of this.

    Wouldn’t it be great if we could set more than one state?  Edit or Add, but then add another state to the Add state, to make Add One or Add Both?

    Who said a form could only be in one state at a time?  Where is it written as law?

    Well yes, it’s true, you can only put your form into one state at a time.  But you can combine more states into one state first.  That’s what stateGroups does, for me at least.

    Here’s an example in code.  The comments inside these marks <!– –> are my warnings and reminders to myself.   Three months from now I won’t need them, because this will all be second nature to me.  Or else I’ll need them badly, because I don’t do this often, and can’t remember the trick of it.

    <!– compound states –>
    <!– script says state_AddBoth, sets two states true: state_AddNew and state_AddHood–>
    <s:states><!– set the first, get the others too –>
    <s:State name=”state_AddNew” stateGroups=”addNew”/>
    <s:State name=”state_SelectHood” stateGroups=”selectHood”/>
    <s:State name=”state_AddHood” stateGroups=”addHood”/>
    <!– only set one of the following three –>
    <s:State name=”state_Edit” />
    <s:State name=”state_AddOne” stateGroups=”addNew,selectHood”/>
    <s:State name=”state_AddBoth” stateGroups=”addNew,addHood”/>
    </s:states>

    So, my script never sets any state but one of the last three: state_Edit, state_AddOne, state_AddBoth.

    But because of the first three, with names I never use anywhere else, I get two-for-one when I ask for state_AddOne or state_AddBoth.

    The three states I set in my script give me FormA (state_Edit), FormB (state_AddOne), or FormC (state_AddBoth).

    But when I say state_AddBoth, for example, I get two states.  I get state_AddNew instead of state_Edit, and I get state_AddHood instead of state_SelectHood.

    Seems we must give those first three states a nickname each time, such as stateGroups=”addNew” for state_AddNew.  We cannot just use the state name state_AddNew in that last line:

    <!– nope! –>
    <s:State name=”state_AddBoth” stateGroups=”state_AddNew,state_AddHood”/>

    Why not?  Don’t know.  Just can’t.  I know because I tried it.  That’s why we wrote a compiler in a class once upon a time.  So we wouldn’t complain when this compiler needs certain clues from us.

    Now which names do you use in your form?  Any of them, I found.  But I try not to use a different name that has the same result.  When I’m tired and rushed some night months from now, I might think I need one or the other, because they work differently.  In my form I use just these three state names:  state_Edit, state_AddOne, and state_AddBoth, corresponding to my FormA, FormB, and FormC.

    Those buttons, for example, that change from FormA to FormB:

    <mx:FormItem>
    <s:HGroup includeIn=”state_Edit”>
    <s:Button label=”Update” click=”onUpdate()”/>
    <s:Button label=”Delete” click=”onDelete()”/>
    <s:Button label=”Close” click=”onClose()”/>
    </s:HGroup>
    <s:HGroup excludeFrom=”state_Edit”>
    <s:Button label=”Clear” click=”clearForm()”/>
    <s:Button label=”Add” click=”onAdd()”/>
    <s:Button label=”Close” click=”onClose()”/>
    </s:HGroup>
    </mx:FormItem>

    I also use includeIn wherever I can, and excludeFrom only when I must.  By some perversity of logic, includeIn is more exclusive, and excludeFrom is more inclusive.  A thing will show up more often with excludeFrom than with includeIn.  Nuts, eh?

    Here’s the difference between FormB and FormC:

    <mx:FormItem label=”When” includeIn=”state_AddOne”>
    <s:DropDownList id=”fHood” change=”onHoodSelect(event)”/>
    </mx:FormItem>
    <mx:FormItem label=”When” includeIn=”state_AddBoth”>
    <mx:DateField/>
    </mx:FormItem>

    Same label When, you see.   But in FormC a date field replaces the dropdown list of FormB.

    You learn some other little things while you build your experiments.

    Put includeIn on the FormItem, not on the DropDownList, for example.  Or else you get the label When with no input beside it.

    Use includeIn instead of visible (such as visible.state_AddOne = false and visible.state_AddBoth = true).  Even when the thing is not visible, it takes up an empty space, a missing tooth the automatic layout cannot fix for you.

    So I’m glad I tried all this inside a separate experiment first.  I made an ugly farce of it more than once.  Glad I built it to throw away.

    ===

    Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

    Categories: tech.

    Some Genius

    I been waiting eight years for some genius to ask why it took me an hour to drive seven blocks.

    Detective Dennehy

    True Believer
    James Woods, Robert Downey Jr

    Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

    Categories: uses.

    Twitter links powered by Tweet This v1.6.1, a WordPress plugin for Twitter.

    Powered by WishList Member - Membership Software