Reputation: 1
I'm creating an animated menu in Flash that I want to embed in PowerPoint and be able to jump to slides in the PowerPoint when clicking buttons in the Flash.
In the Flash the code for communicating with the PowerPoint is:
fig1.onRelease=function(){
fscommand("",2)
}
where fig1 is the movie clip button and fscommand passes the parameters to VBscript attached to the embedded SWF in PowerPoint. The '2' is the slide number I want it to jump to.
In the PowerPoint I'm using this code:
Private Sub ShockwaveFlash1_FSCommand(ByVal command, ByVal args)
With ShockwaveFlash1.SlideShowWindows(1).View
.GotoSlide (args)
End With
End Sub
This code is based on code from another post on this website that was an answer to someone with a similar problem.
Link to a specific slide from Flash file embeded in PowerPoint
My problem is that it's not working for me and I'm getting this VB error:
Compile error:
Expected list separator or )
Along with this error, the word 'command' is highlighted in the first line.
Upvotes: 0
Views: 255
Reputation: 1
Thanks for your help Ansgar. It turns out part of the problem was that I had the wrong name for the Flash object. Right-clicking the SWF and selecting Properties from the contextual menu shows the SWF object name. I made a couple of VB code tweaks and kept the Actionscript the same.
Final Actionscript (button code in Flash):
fig1.onRelease=function(){
fscommand("", 2)
}
Final VB code:
Private Sub ArticulateFlashObject_FSCommand(ByVal command As String, ByVal args As String)
With SlideShowWindows(1).View
.GotoSlide args
End With
End Sub
Upvotes: 0
Reputation: 200393
The error message suggests that you just copy/pasted a VBA macro to a VBScript file. That won't work, since there are notable differences between the two languages. This particular error is most likely caused by the type definitions in the procedure signature. Change this:
Private Sub ShockwaveFlash1_FSCommand(ByVal command As String, ByVal args As String)
into this:
Private Sub ShockwaveFlash1_FSCommand(ByVal command, ByVal args)
You may also need to change
SlideShowWindows(1).View
into
ppt.SlideShowWindows(1).View
or
ppt.ActivePresentation.SlideShowWindows(1).View
where ppt
is a variable referencing your PowerPoint application object.
Upvotes: 1