Movie::SetVariable

Movie::SetVariable
bool SetVariable(const char* ppathToVar, const Value& value, SetVarType setType = SV_Sticky);
bool SetVariable(const char* ppathToVar, const char* pvalue, SetVarType setType = SV_Sticky);
bool SetVariable(const char* ppathToVar, const wchar_t* pvalue, SetVarType setType = SV_Sticky);
Description

SetVariable sets a variable identified by a path to a new value, specified as a string in UTF-8 encoding. The setType argument describes the behavior of SetVariable in case that the movie clip containing the path target variable is not found. 

Specifying SV_Normal argument will cause the SetVariable to return immediately, performing no assignment queuing; it is thus the most efficient type of call and should be used when possible. 

Specifying SV_Sticky flag (default) will cause the value assignment to be pending until its target object is created. This allows initialization of objects created in later key-frames; however, assigned value will not persist if that object is later destroyed and then recreated again by the timeline. 

Specifying SV_Permanent will cause that assignment to apply to all future creations of the target movie clip; it should be used with care as it is the most expensive type of assignment. 

Please note setType argument has a sticky/permanent effect only on variables contained directly in movie clips; it can NOT be used to initialize members of arbitrary ActionScript objects that have not yet been created. 

Parameters
Parameters 
Description 
const char* ppathToVar 
A path or name of the variable to be modified or created. 
const Value& value 
A reference value of type Value that the specified variable will take on. 
SetVarType setType = SV_Sticky 
Describes assignment queuing behavior applied if the target variable or movie clip does not yet exist. Can be SV_Normal, SV_Sticky (default) or SV_Permanent. 
const char* pvalue 
A value that the specified variable will take on, encoded in UTF-8 string format. 
Return Value

A Boolean value of 1 if the value at the target path was available at the time of the call, otherwise 0.