#include <libsswf.h>
Public Member Functions | |
ActionGoto (TagBase *tag, action_t action=ACTION_GOTO_FRAME) | |
Initializes the ActionGoto action. | |
void | SetFrameName (const char *frame_name) |
Set the name of the frame to go to. | |
void | SetPlay (bool play) |
Set whether the animation continues to play after the goto. | |
Private Member Functions | |
virtual Action * | Duplicate (void) const |
Create a duplicate of this action goto. | |
virtual ErrorManager::error_code_t | ParseData (const Data &data) |
Load the extraneous information of the ActionGoto. | |
virtual ErrorManager::error_code_t | SaveData (Data &data, Data &nested_data) |
Save the extraneous information of the ActionGoto. | |
Private Attributes | |
char * | f_frame_name |
unsigned long | f_frame_number |
bool | f_play |
This function initializes the ActionGoto. This means the frame name is set to NULL and the playback flag is set to false (i.e. go to that frame and stop playing.)
The valid actions are:
References sswf::Action::ACTION_GOTO_EXPRESSION, sswf::Action::ACTION_GOTO_FRAME, sswf::Action::ACTION_GOTO_LABEL, sswf::assert(), f_frame_name, and f_play.
Referenced by Duplicate().
Action * ActionGoto::Duplicate | ( | void | ) | const [private, virtual] |
Create a new ActionGoto object copy the frame name and whether to continue or stop playback.
Reimplemented from sswf::Action.
References ActionGoto(), sswf::Action::f_action, f_frame_name, f_play, SetFrameName(), SetPlay(), and sswf::Action::Tag().
ErrorManager::error_code_t ActionGoto::ParseData | ( | const Data & | data | ) | [private, virtual] |
Load the label information of the ActionGoto object.
Note that on the second pass of the Load() function, the goto actions will determine the proper frame names if some are necessary.
[in] | data | The Data buffer where the ActionGoto is loaded from |
Reimplemented from sswf::Action.
References sswf::Action::ACTION_GOTO_EXPRESSION, sswf::Action::ACTION_GOTO_FRAME, sswf::Action::ACTION_GOTO_LABEL, sswf::assert(), sswf::ErrorManager::ERROR_CODE_INTERNAL_ERROR, sswf::ErrorManager::ERROR_CODE_NONE, sswf::Action::f_action, f_frame_name, f_frame_number, f_play, sswf::Data::GetShort(), sswf::Data::GetString(), and sswf::Action::OnError().
ErrorManager::error_code_t ActionGoto::SaveData | ( | Data & | data, | |
Data & | nested_data | |||
) | [private, virtual] |
Save the label information of the ActionGoto object.
[in] | data | The Data buffer where the ActionGoto is to be saved |
[in] | nested_data | There is no nested data in an ActionGoto |
Reimplemented from sswf::Action.
References sswf::Action::ACTION_GOTO_EXPRESSION, sswf::Action::ACTION_GOTO_FRAME, sswf::Action::ACTION_GOTO_LABEL, sswf::assert(), sswf::ErrorManager::ERROR_CODE_INTERNAL_ERROR, sswf::ErrorManager::ERROR_CODE_NONE, sswf::ErrorManager::ERROR_CODE_OBJECT_NOT_FOUND, sswf::Action::f_action, f_frame_name, f_play, sswf::TagBase::FindLabelledTag(), sswf::Action::OnError(), sswf::Data::PutShort(), sswf::Action::SaveString(), sswf::Action::Tag(), and sswf::TagBase::WhichFrame().
void ActionGoto::SetFrameName | ( | const char * | frame_name | ) |
It is possible to give a name to a frame. This action can then be used to go to that frame. You need to use an ACTION_GOTO_FRAME or ACTION_GOTO_LABEL for this purpose. The ACTION_GOTO_EXPRESSION uses the last string on the stack instead.
In case of an ACTION_GOTO_FRAME, the name can actually be a frame number in ASCII (i.e. "15"), otherwise it is the SSWF label name of a frame.
[in] | frame_name | The name of the frame you want to go to |
References f_frame_name, sswf::MemoryManager::MemFree(), and sswf::MemoryManager::StrDup().
Referenced by Duplicate().
void sswf::ActionGoto::SetPlay | ( | bool | play | ) | [inline] |
This function is used to define whether the animation should continue to play after it jumped to the specified frame.
By default, the action says that the animation should stop playing.
[in] | play | The flag to tell whether it should play (true) or not (false) |
References f_play.
Referenced by Duplicate().
char* sswf::ActionGoto::f_frame_name [private] |
Referenced by ActionGoto(), Duplicate(), ParseData(), SaveData(), and SetFrameName().
unsigned long sswf::ActionGoto::f_frame_number [private] |
Referenced by ParseData().
bool sswf::ActionGoto::f_play [private] |
Referenced by ActionGoto(), Duplicate(), ParseData(), SaveData(), and SetPlay().