show/hide a movie via button toggle

  • susancbk
  • Proficient
  • Proficient
  • susancbk
  • Posts: 293
  • Loc: New York City

Post 3+ Months Ago

I have a movie clip that I want to start off invisible.
When I click a button I want to make it visible if its invisible, and invisible if its visible.

im probably doing something way wrong- but here's what i've got (it obviousely isn't working) . is there a better way to do this/how can I fix it?

here's the code for my toggle button
Code: [ Select ]
on (release) {
    if (pronuncationWin.visible == 0) {
        setProperty("pronuncationWin", _visible, 1);
    } else {
        setProperty("pronuncationWin", _visible, 0);
    }
}
  1. on (release) {
  2.     if (pronuncationWin.visible == 0) {
  3.         setProperty("pronuncationWin", _visible, 1);
  4.     } else {
  5.         setProperty("pronuncationWin", _visible, 0);
  6.     }
  7. }


here's the code for the window
Code: [ Select ]
onClipEvent (load) {
 pronunciationWin.visible = 0;
}
  1. onClipEvent (load) {
  2.  pronunciationWin.visible = 0;
  3. }
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • yuriythebest
  • Banned
  • Banned
  • User avatar
  • Posts: 143
  • Loc: Ukraine

Post 3+ Months Ago

yup, you do have some mistakes, I corrected them:


here's the code for my toggle button
Code:

on (release) {
if (pronuncationWin._visible == false) {
pronuncationWin._visible = true;
} else {
pronuncationWin._visible = false;
}
}


Don't bother with the onClipEvent(load) handler to make your clip invisible, simply put pronuncationWin._visible = false; on a frame in your timeline.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 8 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.