Update an Effect in an Interactive Sequence Introduction
Aspose.Slides Cloud API allows you to read, add, and modify animations in PowerPoint presentations. You can use the following method to update an effect in an interactive animation sequence on a presentation slide.
UpdateAnimationInteractiveSequenceEffect
API
Type
Description
Resource
/slides/{name}/slides/{slideIndex}/animation/interactiveSequences/{sequenceIndex}/{effectIndex}
PUT
Updates an effect in an interactive animation sequence on a slide.
UpdateAnimationInteractiveSequenceEffect
Request Parameters
Name
Type
Location
Required
Description
name
string
path
true
The name of a presentation file saved in a storage.
slideIndex
integer
path
true
The 1-based index of a slide.
sequenceIndex
integer
path
true
The 1-based index of an interactive sequence.
effectIndex
integer
path
true
The 1-based index of an effect to be modified.
effect
Effect
body
true
The data transfer object with effect parameters.
password
string
header
false
The password to open the presentation.
folder
string
query
false
The path to a folder containing the presentation.
storage
string
query
false
The name of the storage contaning the folder.
Example
The document MyPresentation.pptx contains one interactive animation sequence with two effects on the first slide. Change the second effect to Split and trigger it on click by the same shape.
cURL Solution
Request
Get an Access Token
curl POST "https://api.aspose.cloud/connect/token" \
-d "grant_type=client_credentials&client_id=MyClientId&client_secret=MyClientSecret" \
-H "Content-Type: application/x-www-form-urlencoded"
Update the Effect
curl -X PUT "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1/animation/interactiveSequences/1/2" \
-H "authorization: Bearer MyAccessToken" \
-H "Content-Type: application/json" \
-d @Effect.json
Effect.json content:
{
"Type" : "Split" ,
"TriggerType" : "OnClick"
}
Response
Response Example
{
"mainSequence" : [],
"interactiveSequences" : [
{
"effects" : [
{
"type" : "Fade" ,
"subtype" : "None" ,
"presetClassType" : "Entrance" ,
"shapeIndex" : 3 ,
"triggerType" : "WithPrevious" ,
"duration" : 0.5 ,
"triggerDelayTime" : 0.0
},
{
"type" : "Split" ,
"subtype" : "HorizontalIn" ,
"presetClassType" : "Entrance" ,
"shapeIndex" : 4 ,
"triggerType" : "OnClick" ,
"duration" : 0.5 ,
"triggerDelayTime" : 0.0
}
],
"triggerShapeIndex" : 2
}
],
"selfUri" : {
"href" : "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1/animation" ,
"relation" : "self" ,
"slideIndex" : 1
}
}
SDK Solutions
C#
using System ;
using Aspose.Slides.Cloud.Sdk ;
using Aspose.Slides.Cloud.Sdk.Model ;
class Application
{
static void Main ( string [] args )
{
SlidesApi slidesApi = new SlidesApi ( "MyClientId" , "MyClientSecret" );
string fileName = "MyPresentation.pptx" ;
int slideIndex = 1 ;
int sequenceIndex = 1 ;
int effectIndex = 1 ;
Effect effect = new Effect
{
Type = Effect . TypeEnum . Split ,
TriggerType = Effect . TriggerTypeEnum . OnClick
};
SlideAnimation slideAnimation = slidesApi . UpdateAnimationInteractiveSequenceEffect ( fileName , slideIndex , sequenceIndex , effectIndex , effect );
Effect updatedEffect = slideAnimation . InteractiveSequences [ sequenceIndex - 1 ]. Effects [ effectIndex - 1 ];
Console . WriteLine ( "Effect type: " + updatedEffect . Type ); // Split
Console . WriteLine ( "Trigger type: " + updatedEffect . TriggerType ); // OnClick
}
}
Java
import com.aspose.slides.ApiException ;
import com.aspose.slides.api.SlidesApi ;
import com.aspose.slides.model.Effect ;
import com.aspose.slides.model.SlideAnimation ;
public class Application {
public static void main ( String [] args ) throws ApiException {
SlidesApi slidesApi = new SlidesApi ( "MyClientId" , "MyClientSecret" );
String fileName = "MyPresentation.pptx" ;
int slideIndex = 1 ;
int sequenceIndex = 1 ;
int effectIndex = 1 ;
Effect effect = new Effect ();
effect . setType ( Effect . TypeEnum . SPLIT );
effect . setTriggerType ( Effect . TriggerTypeEnum . ONCLICK );
SlideAnimation slideAnimation = slidesApi . updateAnimationInteractiveSequenceEffect ( fileName , slideIndex , sequenceIndex , effectIndex , effect , null , null , null );
Effect updatedEffect = slideAnimation . getInteractiveSequences (). get ( sequenceIndex - 1 ). getEffects (). get ( effectIndex - 1 );
System . out . println ( "Effect type: " + updatedEffect . getType ()); // Split
System . out . println ( "Trigger type: " + updatedEffect . getTriggerType ()); // OnClick
}
}
PHP
use Aspose\Slides\Cloud\Sdk\Api\Configuration ;
use Aspose\Slides\Cloud\Sdk\Api\SlidesApi ;
use Aspose\Slides\Cloud\Sdk\Model\Effect ;
use Aspose\Slides\Cloud\Sdk\Model\SlideAnimation ;
$configuration = new Configuration ();
$configuration -> setAppSid ( "MyClientId" );
$configuration -> setAppKey ( "MyClientSecret" );
$slidesApi = new SlidesApi ( null , $configuration );
$fileName = "MyPresentation.pptx" ;
$slideIndex = 1 ;
$sequenceIndex = 1 ;
$effectIndex = 1 ;
$effect = new Effect ();
$effect -> setType ( Effect :: TYPE_SPLIT );
$effect -> setTriggerType ( Effect :: TRIGGER_TYPE_ON_CLICK );
$slideAnimation = $slidesApi -> updateAnimationInteractiveSequenceEffect ( $fileName , $slideIndex , $sequenceIndex , $effectIndex , $effect );
$updatedEffect = $slideAnimation -> getInteractiveSequences ()[ $sequenceIndex - 1 ] -> getEffects ()[ $effectIndex - 1 ];
echo "Effect type: " , $updatedEffect -> getType (), " \n " ; // Split
echo "Trigger type: " , $updatedEffect -> getTriggerType (); // OnClick
Ruby
require "aspose_slides_cloud"
include AsposeSlidesCloud
configuration = Configuration . new
configuration . app_sid = "MyClientId"
configuration . app_key = "MyClientSecret"
slides_api = SlidesApi . new ( configuration )
file_name = "MyPresentation.pptx"
slide_index = 1
sequence_index = 1
effect_index = 1
effect = Effect . new
effect . type = "Split"
effect . trigger_type = "OnClick"
slide_animation = slides_api . update_animation_interactive_sequence_effect ( file_name , slide_index , sequence_index , effect_index , effect )
updated_effect = slide_animation . interactive_sequences [ sequence_index - 1 ]. effects [ effect_index - 1 ]
puts "Effect type: #{ updated_effect . type } " # Split
puts "Trigger type: #{ updated_effect . trigger_type } " # OnClick
Python
from asposeslidescloud.apis.slides_api import SlidesApi
from asposeslidescloud.models.effect import Effect
slides_api = SlidesApi ( None , "MyClientId" , "MyClientSecret" )
file_name = "MyPresentation.pptx"
slide_index = 1
sequence_index = 1
effect_index = 1
effect = Effect ()
effect . type = "Split"
effect . trigger_type = "OnClick"
slide_animation = slides_api . update_animation_interactive_sequence_effect ( file_name , slide_index , sequence_index , effect_index , effect )
updated_effect = slide_animation . interactive_sequences [ sequence_index - 1 ] . effects [ effect_index - 1 ]
print ( "Effect type:" , updated_effect . type ) # Split
print ( "Trigger type:" , updated_effect . trigger_type ) # OnClick
Node.js
const cloudSdk = require ( "asposeslidescloud" );
const slidesApi = new cloudSdk . SlidesApi ( "MyClientId" , "MyClientSecret" );
fileName = "MyPresentation.pptx" ;
slideIndex = 1 ;
sequenceIndex = 1 ;
effectIndex = 1 ;
effect = new cloudSdk . Effect ();
effect . type = cloudSdk . Effect . TypeEnum . Split ;
effect . triggerType = cloudSdk . Effect . TriggerTypeEnum . OnClick ;
slidesApi . updateAnimationInteractiveSequenceEffect ( fileName , slideIndex , sequenceIndex , effectIndex , effect ). then ( slideAnimation => {
updatedEffect = slideAnimation . body . interactiveSequences [ sequenceIndex - 1 ]. effects [ effectIndex - 1 ];
console . log ( "Effect type:" , updatedEffect . type ); // Split
console . log ( "Trigger type:" , updatedEffect . triggerType ); // OnClick
});
C++
#include "asposeslidescloud/api/SlidesApi.h"
using namespace asposeslidescloud :: api ;
int main ()
{
std :: shared_ptr < SlidesApi > slidesApi = std :: make_shared < SlidesApi > ( L "MyClientId" , L "MyClientSecret" );
const wchar_t * fileName = L "MyPresentation.pptx" ;
int slideIndex = 1 ;
int sequenceIndex = 1 ;
int effectIndex = 1 ;
std :: shared_ptr < Effect > effect = std :: make_shared < Effect > ();
effect -> setType ( L "Split" );
effect -> setTriggerType ( L "OnClick" );
std :: shared_ptr < SlideAnimation > slideAnimation = slidesApi -> updateAnimationInteractiveSequenceEffect ( fileName , slideIndex , sequenceIndex , effectIndex , effect ). get ();
std :: shared_ptr < Effect > updatedEffect = slideAnimation -> getInteractiveSequences ()[ sequenceIndex - 1 ] -> getEffects ()[ effectIndex - 1 ];
std :: wcout << L "Effect type: " << updatedEffect -> getType () << " \n " ; // Split
std :: wcout << L "Trigger type: " << updatedEffect -> getTriggerType (); // OnClick
}
Perl
use AsposeSlidesCloud::Configuration ;
use AsposeSlidesCloud::SlidesApi ;
use AsposeSlidesCloud::Object::Effect ;
my $config = AsposeSlidesCloud::Configuration -> new ();
$config -> { app_sid } = "MyClientId" ;
$config -> { app_key } = "MyClientSecret" ;
my $slides_api = AsposeSlidesCloud::SlidesApi -> new ( config => $config );
my $file_name = "MyPresentation.pptx" ;
my $slide_index = 1 ;
my $sequence_index = 1 ;
my $effect_index = 1 ;
my $effect = AsposeSlidesCloud::Object::Effect -> new ();
$effect -> { type } = "Split" ;
$effect -> { trigger_type } = "OnClick" ;
my %parameters = ( name => $file_name , slide_index => $slide_index , sequence_index => $sequence_index , effect_index => $effect_index , effect => $effect );
my $slide_animation = $slides_api -> update_animation_interactive_sequence_effect ( %parameters );
my $updated_effect = $slide_animation -> { interactive_sequences }[ $sequence_index - 1 ] -> { effects }[ $effect_index - 1 ];
print ( "Effect type: " , $updated_effect -> { type }, "\n" ); # Split
print ( "Trigger type: " , $updated_effect -> { trigger_type }); # OnClick
Swift
Go
SDKs
Check Available SDKs to learn how to add an SDK to your project.