I'm trying to use a single button to fire off one type of behavior the first time I press it (it opens a pop up), then have it change color, and then get a different behavior (close pop up) the next time it is pressed. However I cannot seem to get an action to register on the second click.
The first behavior (when backgroundFrame is 0) works. The second one does not. Am I not releasing the actioned() state Am I not updating the live DOM properly
<par begin="id('BTN_EVT')[state:actioned()]" end="false()" >
<cue select="id('BTN_EVT')" dur="1s" fill="hold" use="EventButtonActioned" />
</par>
function OnEventButtonPressed(evt) {
var id = evt.target.getAttribute("id");
if (id == "BTN_EVT") {
if (document.BTN_EVT.style.getProperty("backgroundFrame") == "0") {
document.BTN_EVT.style.backgroundFrame = "2";
document.TXT_TRY.style.display = "auto";
document.TXT_TRY.style.animateProperty("y","-400px;0px","1");
} else if (document.BTN_EVT.style.getProperty("backgroundFrame") == "2") {
document.BTN_EVT.style.display = "none";
document.TXT_TRY.style.animateProperty("y","0px;-400px","1");
}
}
}

Focus not sticking
connexion2000
Thanks again for the help.
John Petritis
The problem is your end="false()" -- that means your <par> will never end, which means it will never re-start. Since it will never re-start, your <cue> will never fire again either, since it has an implicit begin of 0s and is thus not re-startable. Give the <par> a dur of (eg) 5 frames instead of an end and you should be fine.
Also:
can be just:
and instead of:
you can do:
Do you mean to set BTN_EVT's style:display="none" That would mean it wasn't on the screen, which would also mean you could never click it again (or give it the focus)... did you mean to do that to TXT_TRY (In which case, your animation won't be visible to the user since the element will disappear).
Also, I personally don't like referring to the "loaded" and "live" DOMs because there is only one DOM but you can modify some of the properties through animation. So saying "there's a DOM and some animated properties" seems far more clear than saying "there's a loaded DOM and a live DOM and the difference is...."
But that's just me :-)