Objects not showing post export

Topics related to using ToolBook for building web apps.

Objects not showing post export

Postby Robert Stevenson » Wed May 14, 2014 12:53 pm

I have the following for all the question objects in a quiz. They are simply a tick for "yes" and a "x? for "no". They work nicely for feedback until I export where they no longer show. Any suggestions would be appreciated.


-----------------
Actions for Fill in the Blank Question "Fill in the Blank" of Page "evaluation"
--------------------------------------------------------------------------------

-- On question answered... -----------------------------------------------------
If score = "correct"
Set visible of PaintObject "yes" to true
Delay 3000 ms
Set visible of PaintObject "yes" to false
Else
Set visible of PaintObject "no" to true
Delay 3000 ms
Set visible of PaintObject "no" to false
End if
Robert Stevenson
 
Posts: 138
Joined: Wed May 14, 2014 11:46 am

Re: Objects not showing post export

Postby Clifton » Wed May 14, 2014 1:45 pm

Robert Stevenson wrote:I have the following for all the question objects in a quiz. They are simply a tick for "yes" and a "x? for "no". They work nicely for feedback until I export where they no longer show. Any suggestions would be appreciated.


-----------------
Actions for Fill in the Blank Question "Fill in the Blank" of Page "evaluation"
--------------------------------------------------------------------------------

-- On question answered... -----------------------------------------------------
If score = "correct"
Set visible of PaintObject "yes" to true
Delay 3000 ms (THIS LOGIC WON'T WORK IN A IF/THEN STATEMENT)
Set visible of PaintObject "yes" to false
Else
Set visible of PaintObject "no" to true
Delay 3000 ms (THIS LOGIC WON'T WORK IN A IF/THEN STATEMENT)
Set visible of PaintObject "no" to false
End if


Since the visible ... true and visible ... false statements immediately follow each other and the delay isn't recognized in a if/then statement you are effective showing and hiding your objects back to back and thus they will never be seen.

Alternate approach is to use the PowerPac to work the delay.
Like this:
    if score = "correct" then
        Set visible of PaintObject "yes" to true
        Execute Script pgTBObjSet( "yes", "visible", false, 3000); discard return value
    else
        Set visible of PaintObject "no" to true
        Execute Script pgTBObjSet( "no", "visible", false, 3000); discard return value
    end if
What does this do?
When the answer is "correct", the Actions editor will set your PaintObject "yes" to visible and then immediately execute the PowerPac function pgTBObjSet(). The PowerPac function delays hiding the PaintObject for 3000 ms. All PowerPac functions work perfectly in if/then statements and in loops and all other Action Editor structures.

Be careful of one thing when applying the NEW logic to your situation. PowerPac functions require that named objects have unique names, so you can only have one object named "yes". Also object names used in PowerPac functions must be entered case-sensitive as an object named "Yes" is considered different from one named "yes".
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: Objects not showing post export

Postby Robert Stevenson » Wed May 14, 2014 10:56 pm

Wow! I knew there was a reason I purchased the PowerPac. Thanks so much for this. I just wish I had time to go through all the tutorials and see what the potential really is. Summer is coming.
Robert Stevenson
 
Posts: 138
Joined: Wed May 14, 2014 11:46 am

Re: Objects not showing post export

Postby Robert Stevenson » Wed May 14, 2014 11:32 pm

I just wish I could cut and paste that code into the AE as every attempt I make at entering the parameters won't save. Yep! I'm going to have to invest some time into learning this product.
Robert Stevenson
 
Posts: 138
Joined: Wed May 14, 2014 11:46 am

Re: Objects not showing post export

Postby Clifton » Thu May 15, 2014 6:15 am

If you are having trouble installing the logic in this example, you really need to take a look at the following pages in the PowerPac Help API.

  1. How to execute a PowerPac function and set parameters.
    Styles an object with rounded borders using pgStyleObject().
     
  2. Parameters and Videos on using pgTBObjSet().
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: Objects not showing post export

Postby Robert Stevenson » Thu May 15, 2014 2:15 pm

That last "false"? Can't seem to find a spot for it so, of course, the objects show ... for ever. Not good.
Robert Stevenson
 
Posts: 138
Joined: Wed May 14, 2014 11:46 am

Re: Objects not showing post export

Postby Clifton » Thu May 15, 2014 10:33 pm

Make sure you have selected the correct function. It should be pgTBObjSet() and NOT pgTBObjGet(). The former is designed to SET an object property, while the latter is designed to GET a specific property of an object.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: Objects not showing post export

Postby Robert Stevenson » Fri May 16, 2014 10:15 am

I assume here that pgTBObjSet() is the same as pgTBObjSet (HTML)? In the Properties for "execute script" I have myObjname = name of self, myproperty = "visible", myValue = "yes", mydelay = 3000 ... the only other parameters listed are parse group and preventMultidelay ... neither of which seems to make sense for the "false" value.
Robert Stevenson
 
Posts: 138
Joined: Wed May 14, 2014 11:46 am

Re: Objects not showing post export

Postby Clifton » Fri May 16, 2014 10:37 am

myObjName must resolve to the object name that must be manipulated. In your application that would be either the object named "yes" or the one named "no". Therefore, the parameters for pgTBObjSet() should look like this:

Image 1.png
Parameters for object "yes"
Image 1.png (9.88 KiB) Viewed 2088 times

If you use name of self you are resolving to the object on which the function pgTBObjSet() is located at that moment. In your application, that would be undesirable since that is not the object you are manipulating. Instead myObjName must be either "yes" or "no" or whatever the name of the object is that must have its visible property manipulated.

As far as the rest of the parameters, they can be left empty as they apply to other types of object manipulation, which really do not apply to a simple hide/show for a single object.

NOTE: myObjName requires that the object name be entered case-sensitive.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: Objects not showing post export

Postby Robert Stevenson » Fri May 16, 2014 4:13 pm

All seems so wonderfully logical but alas I can't get it to work... object visibility persists. I even renamed the objects from their original "yes" and "no" thinking that might help but no difference.
Robert Stevenson
 
Posts: 138
Joined: Wed May 14, 2014 11:46 am

Next

Return to Web (DHTML) Development

Who is online

Users browsing this forum: No registered users and 2 guests

cron