A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: _visible statement

  1. #1
    I am trying to play a different frame in a target depending on what pic is already loaded.

    on (press) {
    if (_level0.back.backpic1._visible) {
    tellTarget ("back") {
    gotoAndPlay (7);
    if (_level0.back.backpic2._visible) {
    tellTarget ("back") {
    gotoAndPlay (18);
    }
    }
    }
    }
    }
    Can anyone see what I am doing wrong here. I put the path "(_level0.back" after looking at the movie in movie explorer figuring that might help me.

  2. #2
    Senior Member
    Join Date
    Mar 2001
    Posts
    246
    Looks like your second if-statement is located inside the tell-target statement. Try this:
    on (press) {
    if (_level0.back.backpic1._visible) {
    tellTarget ("back") {
    gotoAndPlay (7);
    }
    }
    if (_level0.back.backpic2._visible) {
    tellTarget ("back") {
    gotoAndPlay (18);
    }
    }
    }

    Think this should work,
    HC

  3. #3

    re

    (_level0.back.backpic1._visible) is giving me trouble when i specify the movieclip "back" the the script works. I don't think it can tell if backpic1 (which is an instance graphic is visible ??????? needless to say it doesn't work but thankyou for your speedy reply!!

  4. #4
    Senior Member
    Join Date
    Mar 2001
    Posts
    246
    The _visible property only applies to movieclips, if you want to check this you need to make your graphic a movieclip instance, and make sure the instance is named 'backpic1'. Then your script should work.

    regards,
    HC

  5. #5

    movie clip instance

    It did work however, for some reason when i debug i see _level0.back.instance2 instead of _level0.back.backpic1

    I am not sure why it is not showing the name of the movie clip I did specify it on the toolbar under instance.

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