dcsimg
A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: SetProperty and If statement

  1. #1
    Senior Member dduck1934's Avatar
    Join Date
    Sep 2000
    Location
    Georgia, USA
    Posts
    155

    Smile

    I know this should be an easy answer


    I am creating a small interactive game and I have x amount of squares. When each square is clicked on it either makes a movie clip visable or not visable depending on what is visible to start with.

    I want to put a statement in there that says if the visiblity of all the movie clip instances are equal to 0, then go to and play another frame.

    I am new to actionscript in general, but any help would be appreciated.

    Is there a way to say like If movie1, movie2, movie3, movie4, visibility = 0, then go to say frame 5?

  2. #2
    Senior Member dduck1934's Avatar
    Join Date
    Sep 2000
    Location
    Georgia, USA
    Posts
    155

    Smile I can give you the .fla

    I have the .fla file if anybody wants to take a look at what i am trying to do. I know there is probably an easier way to do this the way I am doing it, but i would like any help i can get.

    Thanks.

    dduck

  3. #3
    Senior Member dduck1934's Avatar
    Join Date
    Sep 2000
    Location
    Georgia, USA
    Posts
    155

    Smile My flash file

    Here you can see my flash file.

    Again I am trying to make it where if the property of 5 instances are = to 0, then i want it to go to frame 5.

    http://www.crosswinds.net/~dduck1934/flash5/lights2.fla

  4. #4
    Senior Member
    Join Date
    Oct 2000
    Posts
    122

    I know

    Yo!
    That's an easy question. Here's the following actionscript to your dilema;

    if {(Number(getProperty("/light1", _visible) == 0 and (Number(getProperty("/light2", _visible) == 0 and .....}
    gotoandplay(number);

    This is supposed to be a lights out type game? Good idea for flash.

    Ps. This may not be 100% right. If it isn't, reply back and i'll try again.

    [Edited by Mr Mayonnaise on 11-05-2000 at 03:08 PM]

  5. #5
    Senior Member dduck1934's Avatar
    Join Date
    Sep 2000
    Location
    Georgia, USA
    Posts
    155

    Smile hmm... tried

    In my flash file. I did not set any variables, just properties.

    I tried what you said, and it didn't work. It may be me though. I am trying to learn more than just Basic Actionscript, so I decided to try a simple game.

    I dont know if it would be easier to set a variable, but I am not at all familiar about using variables in flash.

    I'll keep working on it.

    did you by chance download the .fla file and see how i have it set up?


    dduck1934

  6. #6
    Senior Member
    Join Date
    Oct 2000
    Posts
    122
    Man, i just made a mess of the actionscript, and i then editied it again! Look at it once more!

  7. #7
    Senior Member dduck1934's Avatar
    Join Date
    Sep 2000
    Location
    Georgia, USA
    Posts
    155

    Smile it works!!

    Thanks Man it works just fine now.

    I played around with it to see exactly where that if statment needed to go and it works now. now i just got to add more boxes and everything since all the code works now.


    dduck1934

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center