I have this simple code to play with xml
var testXML:XML = <family>
<father name1="tom" age="5" ></father>
<mother name1="tomylee" age="55" ></mother>
<sister name1="sister1" age="35" ></sister>
</family>;
for each(var element:XML in testXML.elements()) {
trace(element.@name1);
}
It should get only one output like
tom
tomylee
sister1
tom
tomylee
sister1
tom
tomylee
sister1
and many more like that. Looks like it keeps repeating. The croll bar keep开发者_如何转开发s moving down. I think loop is not stopping
Is this code in a frame script? If you have more than one frame on your timeline, flash will play through them in sequence and repeat, by default. You can use the stop()
command to stop playback on the current frame, or if you only put a single frame in the timeline, it will only execute once.
精彩评论