Object Appears on Another Slide

  • Thread starter Thread starter Desmond777
  • Start date Start date
D

Desmond777

I am trying to make a game that will allow the player to have an inventory. I
need a way to have an object appear in the inventory when another objects is
"mouse-overed."
Can someone give me the VBA code for this?
Thanks!
 
You have actionSettings for mouse over.
So write a action setting to run a macro and in the macro set the
vissibility of the object as vissible (msoTrue)
 
Hi Desmond,

As I dont know whats the exact way you doing
So I feel only one way

Select the object which you want to keep vissible and to set actionsettings
for mouse over and run this function

Sub PrepareVissibleShape()
With ActiveWindow.Selection.ShapeRange(1)
.Visible = msoTrue
.Name = "VissibleObj"
.ActionSettings(ppMouseOver).Action = ppActionRunMacro
.ActionSettings(ppMouseOver).Run = MakeShapeVissible
End With
End Sub

Now Select the shape which you want to make invissible and run this macro
Sub PrepareInvissibleShape()
With ActiveWindow.Selection.ShapeRange(1)
.Visible = msoFalse
.Name = "InvissibleObj"
End With
End Sub

Also keep this macro in the same module
Sub MakeShapeVissible()
Dim sh As Shape
For i = 1 To ActivePresentation.Slides(1).Shapes.Count 'Change Slide index
accrodingly
With ActivePresentation.Slides(1).Shapes(i)
If .Name = "VissibleObj" Then
.Visible = msoFalse
ElseIf .Name = "InvissibleObj" Then
.Visible = msoTrue
End If
End With
Next i
End Sub

Now you try slideshow and see if it works.
Check this website if you don't know where to write VBA code
http://pptfaq.com/FAQ00033.htm
 
Does it have to be a mouseover? A triggered animation is likely to be more
reliable but this would have to be a click.

Can you explain " .... on another slide" though. If you need an object to
appear on a DIFFERENT slide then it would have to be vba.

Using vba to set the visible property can cause problems with other
animations and also once set to true or false it will stay that way next time
you run the presentation unless you write code to initialise it how you want.

tutorials on triggers
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html#triggers
--
Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk
 
The basic code is:

ActivePresentation.Slides(###).Shapes(###).Visible = msoTrue

This makes an object on another slide visible. Change msoTrue to
msoFalse to make the object invisible. You replace the ###s with slide
and shape numbers or names. I have examples of the basic idea on my Web
site. Most of them change the visibility of an object on the same slide,
but some of the examples change it on another slide. Go to
http://www.PowerfulPowerPoint.com/ and look at some of the examples.
Example 6.6 is probably the simplest example of this. Just click on
"Examples by Chapter" and "Chapter 6."

--David
 
Back
Top