Lastly, we need to check to see if we've won. A loop that counts the visible pegs will work just fine.
Set Variable: "count" = 0 Set Variable: "loop" = 0 Loop While (loop <= 13) Set Variable: "loop" = loop + 1 If (GetProperty ("/p" & loop, _visible ) = 1) Set Variable: "count" = count + 1 End If End Loop If (count=1) Begin Tell Target ("/") Go to and Stop ("win") End Tell Target End If
Where the count = 1 then we know we have reached the winning condition. This tell targets my root movie and goes to the frame labeled "win". This frame should also have a Stop action assigned to it.
Hopefully this will give you some of the inside information you need to create your own scripted Flash masterpieces.
|» Level Intermediate|
Rating: 7.97 Votes: 140
|Download the files used in this tutorial.|
|Download (21 kb)|
|More help? Search our boards for quick answers!|