A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: set property for movie

  1. #1
    Member
    Join Date
    Dec 2003
    Posts
    32

    set property for movie

    I made a movie called mymovie which is used as an effect that has two appear only sometimes. Therefore I made a little actionscript to either display the movie or not. (see script below) But for some reason this does not work. No matter what the value of 'counter' is Flash allways takes the first line of the script (i.e. mymovie._visible = true).

    Can someone explain to me why Flash skips the If-statement in this case?

    counter = 1;
    if (counter = 0) {
    mymovie._visible = true;
    } else {
    mymovie._visible = false;
    }

  2. #2
    Member
    Join Date
    Dec 2003
    Posts
    58

    you're using the wrong operator

    this should work:

    counter = 1;
    if (counter == 0) {
    mymovie._visible = true;
    } else {
    mymovie._visible = false;
    }


    and while I'm at it, try this:

    mymovie._visible = counter == 0;

    or this:

    mymovie._visible = Boolean(counter);

  3. #3
    Member
    Join Date
    Dec 2003
    Posts
    32
    Thanx Pecoes, that helps a lot

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