Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Actionscripting

Categories How to Build the Peg Puzzle Game
Author: David Brebner

 
Page 5
«prev 1 2 3 4 5

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.
Cheers,
David Brebner.

«prev 1 2 3 4 5

» Level Intermediate

Added: : 2000-06-29
Rating: 8.03 Votes: 132
Hits: 7909
» Author
--
» Download
Download the files used in this tutorial.
Download (21 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments
 
   
 


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers