9 Replies - 782 Views - Last Post: 02 September 2010 - 06:46 PM

#1 TheOne6152  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 36
  • Joined: 11-February 09

how to hide a form until a background is shown?

Posted 02 September 2010 - 03:23 PM

I made a form and i want it to be invisible until the background's alpha is 100% and dissappear when the backgrounds alpha is anything other than 100.

reserv_form is the form
reservations_box is the background

this is what i have but it dosent work:
reserv_form._alpha = 0;

if (reservations_box._alpha = 100){
	reserv_form._alpha = 100;
} else if(reservations_box._alpha =! 100){
	reserv_form._alpha = 0;
}


Is This A Good Question/Topic? 0
  • +

Replies To: how to hide a form until a background is shown?

#2 nick2price  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 562
  • View blog
  • Posts: 2,826
  • Joined: 23-November 07

Re: how to hide a form until a background is shown?

Posted 02 September 2010 - 03:39 PM

You are doing an assignment, not a comparison.
if (reservations_box._alpha = 100)


To see if it is equal to 100, you need to use ==
if (reservations_box._alpha == 100)


FOr your else if aswell, i would use a < symbol instead. Plus, its != not =!
Was This Post Helpful? 1
  • +
  • -

#3 TheOne6152  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 36
  • Joined: 11-February 09

Re: how to hide a form until a background is shown?

Posted 02 September 2010 - 03:54 PM

I changed what u told me to change and it still didn't work. But when I put a number less then 100, for the if statement the form was gone but never came up when the background was at 100% alpha.

This post has been edited by TheOne6152: 02 September 2010 - 03:56 PM

Was This Post Helpful? 0
  • +
  • -

#4 nick2price  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 562
  • View blog
  • Posts: 2,826
  • Joined: 23-November 07

Re: how to hide a form until a background is shown?

Posted 02 September 2010 - 04:12 PM

try
reserv_form._alpha = 0;

if (reservations_box._alpha > 99){
	reserv_form._alpha = 100;
} else if(reservations_box._alpha <= 99){
	reserv_form._alpha = 0;
}


Was This Post Helpful? 1
  • +
  • -

#5 TheOne6152  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 36
  • Joined: 11-February 09

Re: how to hide a form until a background is shown?

Posted 02 September 2010 - 04:54 PM

View Postnick2price, on 02 September 2010 - 03:12 PM, said:

try
reserv_form._alpha = 0;

if (reservations_box._alpha > 99){
	reserv_form._alpha = 100;
} else if(reservations_box._alpha <= 99){
	reserv_form._alpha = 0;
}


still doesn't work =(

heres the site if u wanna actually see what i'm talking bout http://designefex.com/Home.swf

The form is visible and when you click reservation that white box that pops up is the background
Was This Post Helpful? 0
  • +
  • -

#6 nick2price  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 562
  • View blog
  • Posts: 2,826
  • Joined: 23-November 07

Re: how to hide a form until a background is shown?

Posted 02 September 2010 - 05:16 PM

Ok, just looked at some of your code, and your using AS2. Lets try something else. Firstly, turning the alpha on and off may hint to a bit of a design issue. Really, you should just make the whole form a movieclip, and add it to its own frame, and then goto this frame if the button is clicked. But for now, try this instead.

Firstly, your form isnt even being set invisible from the start using this line
reserv_form._alpha = 0;


So there is something going wrong here. I take it reserv_form is the actual form, and not the white box. So, instead, try
reserv_form._visible = false;


See if that works for now
Was This Post Helpful? 1
  • +
  • -

#7 TheOne6152  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 36
  • Joined: 11-February 09

Re: how to hide a form until a background is shown?

Posted 02 September 2010 - 05:38 PM

View PostTheOne6152, on 02 September 2010 - 03:54 PM, said:

View Postnick2price, on 02 September 2010 - 03:12 PM, said:

try
reserv_form._alpha = 0;

if (reservations_box._alpha > 99){
	reserv_form._alpha = 100;
} else if(reservations_box._alpha <= 99){
	reserv_form._alpha = 0;
}


still doesn't work =(

heres the site if u wanna actually see what i'm talking bout http://designefex.com/Home.swf

The form is visible and when you click reservation that white box that pops up is the background


ok i changed it and it now is invisible, but it doesnt show up when the box comes up

now should change this
reserv_form._visible = false;
 
if (reservations_box._alpha > 99){
    reserv_form._alpha = 100;
} else if(reservations_box._alpha <= 99){
    reserv_form._alpha = 0;
}



to this?
reserv_form._visible = false;
 
if (reservations_box._alpha > 99){
    reserv_form._visible = true;
} else if(reservations_box._alpha <= 99){
    reserv_form._visible = false;
}


Was This Post Helpful? 0
  • +
  • -

#8 nick2price  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 562
  • View blog
  • Posts: 2,826
  • Joined: 23-November 07

Re: how to hide a form until a background is shown?

Posted 02 September 2010 - 05:51 PM

might be better to do
reserv_form._visible = false;
	  
if (reservations_box._visible == true){ //might try alpha if this dont work
    reserv_form._visible = true;
} else{
    reserv_form._visible = false;
}

Was This Post Helpful? 1
  • +
  • -

#9 TheOne6152  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 36
  • Joined: 11-February 09

Re: how to hide a form until a background is shown?

Posted 02 September 2010 - 06:14 PM

View Postnick2price, on 02 September 2010 - 04:51 PM, said:

might be better to do
reserv_form._visible = false;
	  
if (reservations_box._visible == true){ //might try alpha if this dont work
    reserv_form._visible = true;
} else{
    reserv_form._visible = false;
}


still dosent work. what was tht other thing u were saying about making the form a movieclip?

This post has been edited by TheOne6152: 02 September 2010 - 06:18 PM

Was This Post Helpful? 0
  • +
  • -

#10 TheOne6152  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 36
  • Joined: 11-February 09

Re: how to hide a form until a background is shown?

Posted 02 September 2010 - 06:46 PM

i got it, but is there any way to delay the "reserv_form._visible = true;" a certain number of frames?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1