Hi,
I’m writing a library that applies xml-configured states to a movieclip. It works fine, except when applied to nested clips.
Now you might think it is because I am failing to get a reference to objects on particular frames because that frame has not played yet…
In fact the code waits for an added event before it applies a state value to a targeted timeline object.
THE PROBLEM IS: the SECOND time (and all times after) that a particular state and a particular value override is called, it doesn’t stick.
So for instance, I have configured a frame override and a textfield override. Basically, a view state goes to a frame and sets the value of a textfield on that frame. It works the first time perfectly. But the second time a. the textfield traces out with the right (new set value) but it shows only its existing value, and b. the override’s call to gotoAndStop(targetFrame) is called, but it does not change the currentFrame value in that frame, or the next, or any frame.
I’m baffled. Clearly the frame and textfield have been loaded into memory, I can trace them out, and set their values, but it is as if they lost their relation to the timeline. I shouldn’t have to wait for them to be added to the stage again, right? Wrong?
Here’s the states config to give you a better idea what I am doing:
<states>
<state name="one">
<frame target="content" label="one"/>
<field>
<path>content.field</path>
<text>one new</text>
</field>
</state>
<state name="two">
<frame target="content" label="two"/>
<field>
<path>content.two.field</path>
<text>two new</text>
</field>
</state>
<state name="three">
<frame target="content" label="three"/>
<frame target="content.three" label="testAgain"/>
<field>
<path>content.three.field</path>
<text>three new</text>
</field>
<field>
<path>content.three.four.field</path>
<text>four new</text>
</field>
</state>
</states>