View Full Version : Stuck with the code!
Cummins
07-23-2006, 07:39 AM
I have two images with fading effects on one page. When page shows Image 1 will fade in automatically and if the user wishes, Image 2 will fade in while the first one is fading out on a click. Only one at a time can be visible.
Anyway, the question is that when exiting the page whichever is visible should fade out. On exit if Image 1 is visible, this will fade out, if it is Image 2 then this will fade out (for loop). I have tried a couple codes but somehow I couldn't manage it. Can someone show me how to do this?
TJ_Tigger
07-23-2006, 08:20 AM
I would use the timer again when you want to fade out and jump. I would have code in the On Timer event that checks to see if an exit variable is set to true. If it is true then it would fade out the active image and when that is done it does a page jump.
if blnExit then
nOpacity = Image.GetOpacity(sOutImage) -5
if nOpacity <= 0 then
Page.Jump("Page2");
else
Image.SetOpacity(sOutImage, );
end
end
--On Click events
if Image.IsVisible("Image1") then
sOutImage = "Image1";
else
sOutImage = "Image2"
end
blnExit = true;
Page.StartTimer(100);
Cummins
07-23-2006, 09:12 AM
TJ
Sorry to burden you with yet another question but I am not really comfortable with all these code stuff. So please be patient with this newbie.:)
I guess there are two codes here for 2 different events (or am I wrong?). If so which events are they for? Also, I think there is something wrong at the end of the line 6 coz it gives an error message. Do I need a seperate code in the On Timer?
TJ_Tigger
07-23-2006, 09:16 AM
sorry, the top part was for the On Timer event and the bottom was for the On Click action for the button that will exit the page.
Powered by vBulletin™ Version 4.0.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.