PDA

View Full Version : Stuck with the code (2)


Cummins
07-25-2006, 06:50 AM
TJ (and other masters)

Unfortunately things are going as smooth as they should be. You will recall that last week (or the week before) I wrote about a similar problem but this is slightly different. Again, I have two images with fading effects in one page. When page loads they both fade in simultaneously and fade out in the same way on exit. There is no problem with that. However, when I click on exit button, one of the images disappears and appears for a split second before they both start fading out. In other pages, I applied the same action to a few small images but because of their small size it is hardly noticeable.

On Preload
Image.SetOpacity(“Image1”);
Image.SetOpacity(“Image2”);

On Show
Image.SetOpcaity(“Image1”, step);
for step = 0, 100, 8 do
Image.SetOpacity(“Image1”, step);
Image.SetOpacity(“Image2”, step);
End

On close
Image.SetOpcaity(“Image1”, step);
for step = 100, 0, -8 do
Image.SetOpacity(“Image1”, step);
Image.SetOpacity(“Image2”, step);
End

You may suggest setting images to not be visible before I leave and visible again On Preload but this may not be the perfect solution as it spoils the harmony. What do you think I should do?

TJ_Tigger
07-25-2006, 08:13 AM
The reason it disappears for a second is the first line in the On Close event above. You set the opacity to a variable called "step". Most likely that variable has a value of 0 when you start to use it then it goes back to 100 as part of your for loop and back down to 0.

Cummins
07-25-2006, 09:39 AM
TJ

I simply got rid of the first line and it now works perfectly. I would like to say that it is you guys making this forum such enjoyable. Thanks a lot and keep up the hard work.