Skip to main content
August 2, 2011
Question

Conditional Statements, student working on finals... help =(

  • August 2, 2011
  • 1 reply
  • 568 views

Please help me! I have been working on finals since 8 am just today... it is now almost midnight and I am exhausted! Can someone please help me???

What I'm trying to do is simply click on a button and then have a info box i have created show up. I have the visibilty set to false and then it'll go to true... but, maybe it's the time of the day, but I can't get my conditional to work, I can't find any resources to help me out.... basically what i want is this.

function infoBox1(evt:MouseEvent)
{
if (myBtn is clicked)

{
  this.infoBox_mc.visible=true;
}

myBtn.addEventListener(MouseEvent.CLICK,infoBox1);

it's possible this could all be wrong... but can anyone help me pls?

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
August 2, 2011

use:


function infoBox1(evt:MouseEvent)
{
  this.infoBox_mc.visible=true;
}

myBtn.addEventListener(MouseEvent.CLICK,infoBox1);

August 3, 2011

I tired that, and now it's telling me

TypeError: Error #1010: A term is undefined and has no properties.

at BridalGownGuide_fla::MainTimeline/frame20()

at flash.display::MovieClip/gotoAndStop()

at Function/()

Inspiring
August 3, 2011

Action Script 3 is case sensitive.  Make sure the 'f" in function is lower case, not capitalized.