Where am I in an Animation?

P

Paul Simpson

Hi,

I think I've gotten my head around the timeline stuff and have managed to
trap the event which is triggered by an animation. The trouble is, I need to
find out which object has just been animated. How do I do this in VBA?

My app (well, plugin) is a timer utility (which I intend to make available
once it's finished). I need to know when my object appears. This is easy
enough if it is simply on a slide, however if it appears as part of an
animation, I need to know! This is further complicated by the multiple
animations that can be running at a time (Main Timeline on both the slide and
the master, then the various other timelines on each....)

Can anyone advise on this?

Thanks,

Paul
 
A

Austin Myers

Paul Simpson said:
Hi,

I think I've gotten my head around the timeline stuff and have managed to
trap the event which is triggered by an animation. The trouble is, I need
to
find out which object has just been animated. How do I do this in VBA?

Depending on your needs and what yo want to do there are a number of ways
you might do this.

Assuming you are using the "SlideShowNextBuild" Event you with need to use
an "If" statement and test for the object you are looking for. (If its a
large number of objects on the slide you might use a "Case" statement as
they are a lot faster than an "If".) Each object on the slide is assigned a
number (index) and you can test for that, or you can test to see what type
of object it is, and if its a text box you could compare the string that it
holds.

You might also consider using the "Sequences Collection" which is an "index"
of all the animated objects in the "Timeline" of the slide/presentation.
Using the "SlideShowNextBuild" Event to trigger your code you would simply
get a return of the "index" of the current animation and add 1. (Adding 1
is required because the "SlideShowNextBuild" is fired BEFORE the build
happens.)

Let us know how it goes!


Austin Myers
MS PowerPoint MVP Team

Provider of PFCPro, PFCMedia and PFCExpress
www.playsforcertain.com
 
P

Paul Simpson

Thanks for the response. Yes, I'm using the "SlideShowNextBuild" event, but
I'm not sure how to impliment your suggestion!

Basically, what I want is a reference to the item that's just been animated.
I don't know how to retrieve this from the parameter supplied to
"SlideShowNextBuild" (a slideshowwindow object).

Can you advise?

Thanks,

Paul
 
A

Austin Myers

Paul Simpson said:
Thanks for the response. Yes, I'm using the "SlideShowNextBuild" event,
but
I'm not sure how to impliment your suggestion!

Basically, what I want is a reference to the item that's just been
animated.
I don't know how to retrieve this from the parameter supplied to
"SlideShowNextBuild" (a slideshowwindow object).



You can't, SlideShowNextBuild is an event sink, it does nothing but flag
your code of the next event (build). From there your code must determine
what the object is. It's hard to tell exactly what it is you are doing but
I think the "Sequences Collection" is what you are after.

Do you have the documentation file "vbapp10.chm"? It has a couple examples
of using the "Sequences Collection" in your code. If not go to the
www.microsoft.com and do a search for "vbapp10.chm".



Austin Myers
MS PowerPoint MVP Team

Provider of PFCPro, PFCMedia and PFCExpress
www.playsforcertain.com
 
P

Paul Simpson

I had a quick look at the docs you suggested and they certainly will prove
useful, thanks!

The problem I have is, however, not so much knowing which event in a
timeline ocured (I have managed to bodge that one!) but more which timeline
it ocurred on.

Let us say I have two animation sequences, one on the slide, but a second on
the master. I assume (correct me if I'm wrong here!) that when either of them
has an event, then the same "SlideShowNextBuild" sub will be called. So how
would I determine which timeline is active? It seems to me that without some
method of working out which object caused the "SlideShowNextBuild" event,
then trapping it is nearly useless, so there MUST be a solution!

I will continue to play and post back if / when I make some progress :)

Paul
 
A

Austin Myers

Let us say I have two animation sequences, one on the slide, but a second
on
the master. I assume (correct me if I'm wrong here!) that when either of
them
has an event, then the same "SlideShowNextBuild" sub will be called.

Ah, that's where enumerating the objects comes in. Lets say you have a
textbox on the Master Slide, if you enumerate the objects on say slide 2 you
will only find the ones on that slide. You will NOT see the ones on the
master slide, for that you have to enumerate the objects on the master
slide.

So,,, Lets say you are looking for a text box with "Hello World". The
ShileShowNextBuild event is fired and your code catches it. (Your event
trap) Now you look through (enumerate or using the collections index) for
your object on Slide 2. Hmm, not there, ok, now do the same with the slide
master, there is it, now go with your code as desired.


Austin Myers
MS PowerPoint MVP Team

Provider of PFCPro, PFCMedia and PFCExpress
www.playsforcertain.com
 
P

Paul Simpson

Ahhh yes, BUT:-

I have a timer object (which is the point of my plugin) which I have created
using tags to store the extra information I need.

Ok, let us say I have two timers on a slide, plus a third on the master. All
are set to appear as part of an animation sequence. When I get the build
event, how do I know which one has just appeared (so I can start it)?

Now, I can set up a global variable to count every time the event fires, so
providing it is only the slide's animation we are talking about, everything
will work since the count will be the index of the most recent event. I can
then test to see if this is an entrance and if it's one of my timers.
Unfortunately, it all goes pear-shaped if we have two concurrent timelines
going since I would need two counters and then need to know which one to
update.

See my problem?

Paul
 
A

Austin Myers

Paul, getting to complex to "see" it from the description.

What are these timers? (Microsoft provided activex controls?)


Austin Myers
MS PowerPoint MVP Team

Provider of PFCPro, PFCMedia and PFCExpress
www.playsforcertain.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top