Skip to main content
Participant
May 30, 2012
Answered

Test to see if a movie clip is visible?? Instead of setting it

  • May 30, 2012
  • 1 reply
  • 2493 views

Im trying to see if a movie clip's visible property is true or false. If it's true then I want it to move the frame.. Instead my code is making the visible property equal to true on a swipe?? How can I only test and not set the property? It still swipes, just instantly makes it visible.

if(e.offsetX == -1)

                              {

                                        if(this.visible = true) {

                                        nextFrame();

                                        }

                              }

                              else if(e.offsetX == 1)

                              {

                                        if(this.visible = true) {

                                        prevFrame();

                                        }

                              }

This topic has been closed for replies.
Correct answer Rothrock

You are using the asignment = instead of the comparison ==

You want something like:

if(this.visible==true)

However when you are using values that are true or false you can leave out the comparison completely

if(this.visible)

is the same. And if you wanted not visible

if(!this.visible)

You would read the ! as the word not.

1 reply

RothrockCorrect answer
Inspiring
May 30, 2012

You are using the asignment = instead of the comparison ==

You want something like:

if(this.visible==true)

However when you are using values that are true or false you can leave out the comparison completely

if(this.visible)

is the same. And if you wanted not visible

if(!this.visible)

You would read the ! as the word not.

myszakf1Author
Participant
May 30, 2012

that worked perfect!!!

Inspiring
May 31, 2012

Glad that helped. I've been doing this for a LONG time and every now and then I still type only one equal sign and then can't figure out why it is broken!