fadeObject()?

Help for using specific functions

fadeObject()?

Postby PetrH » Sun Feb 02, 2014 1:24 pm

Using Toolbook 11.5, IE10, and version 11.82.323 beta of the PowerPac. I'd update the PowerPac but the download isn't available at the moment (Sunday morning).

I am trying to use the fadeObject() function to effectively achieve a one-time fade with notification when complete. To accomplish this, I'm using the fadeObject() function to set the opacity of another button to zero over 2000 milliseconds. If I understand the function, I also have to set this function to loop in order to generate the notification.

I've set up a test and the fadeObject() function is working and looping but not sending the notification message to the object I'd like to receive the notification. In the object that should be notified, I have an OnUserEvent handler set up to stop the fadeObject() animation immediately. Since this OnUserEvent isn't being triggered, it is suggesting the function is failing, or I've misunderstood something.

I've also noticed that if my fadeObject() call sets the opacity to 0 in the animation, it will not loop. So I changed the call to set it to "10" during this test and I can see the loop as expected but I still don't seem to be generating the notification I expected.

Help?

Thanks,
Peter H.
Peter
Always available for Toolbook work.
[email protected]
PetrH
 
Posts: 22
Joined: Mon Jan 20, 2014 11:29 pm

Re: fadeObject()?

Postby Clifton » Sun Feb 02, 2014 11:18 pm

I just tried this using the latest version (v11.82.593) ... which should be online now.
My test case went like this:
  1. Draw a rectangle and name it Rect1
  2. On click event for the rectangle I execute fadeObject() with following parameters:
    • tbName = name of self
    • fade_in_time = 2000
    • maxOpacity = 100
    • fade_out_time = 2000
    • minOpacity = 0
    • loop = true
    • stop = [not set]
    • notifyOnLoop = true
  3. On user event for rectangle Rect1 I placed this action to verify the event is received when a loop occurs:
    Display alert: value
  4. Exported the page and it seems to work as expected.
Please let me know if you are still experiencing a problem. Maybe you are trying to set notifyOnLoop to an object name. The only object the function is intended to notify is the one that is being faded in or out.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: fadeObject()?

Postby PetrH » Mon Feb 03, 2014 7:23 pm

Thanks for the reply... yes, I was trying to send notification to a different object than the one that is being faded. I'm sure that is why I couldn't get it to work.

Peter
Peter
Always available for Toolbook work.
[email protected]
PetrH
 
Posts: 22
Joined: Mon Jan 20, 2014 11:29 pm

Re: fadeObject()?

Postby Clifton » Mon Feb 03, 2014 8:58 pm

I will look into some beneficial enhancements to this function in the near future. By the way, you can stop a looping fadeObject() routine by setting the stop parameter = true OR by executing the function stopStyleAnimation(). The latter function has a few more options that can be applied when stopping the fade effect like preventing the reset of the object style, which is a probably worth a look when stopping a fade. Also make sure the object you are fading is set to the the correct state before the fade begins as this will give a more pleasing result.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am


Return to Function Help

Who is online

Users browsing this forum: No registered users and 3 guests

cron