libsswf: sswf::ActionGoto Class Reference

# sswf::ActionGoto Class Reference

A goto action to change the current frame. More...

`#include <libsswf.h>`

Inheritance diagram for sswf::ActionGoto:

List of all members.

## 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

## Detailed Description

This action is used in ActionScripts to change the current frame to display.

See also:
  SWF Alexis' Reference—Goto Expression

  SWF Alexis' Reference—Goto Frame

  SWF Alexis' Reference—Goto Label

## Constructor & Destructor Documentation

ActionGoto::ActionGoto | ( | TagBase * | tag,
|  | action_t | action = `ACTION_GOTO_FRAME` |
| ) |  |  |

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:

- ACTION_GOTO_FRAME
- ACTION_GOTO_LABEL
- ACTION_GOTO_EXPRESSION

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().

## Member Function Documentation

Action * ActionGoto::Duplicate | ( | void |  | ) | const`[private, virtual]`

Create a new ActionGoto object copy the frame name and whether to continue or stop playback.

Returns:
  The new ActionGoto object

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.

Parameters:

  `[in]` | data | The Data buffer where the ActionGoto is loaded from

Returns:
  An error code or ErrorManager::ERROR_CODE_NONE

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.

Parameters:

  `[in]` | data | The Data buffer where the ActionGoto is to be saved
  `[in]` | nested_data | There is no nested data in an ActionGoto

Returns:
  An error code or ErrorManager::ERROR_CODE_NONE

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.

Bug:
  In case of an ACTION_GOTO_LABEL, whether the label exists in the movie is not being tested by the library.

Parameters:

  `[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.

Parameters:

  `[in]` | play | The flag to tell whether it should play (true) or not (false)

References f_play.

Referenced by Duplicate().

## Member Data Documentation

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().

The documentation for this class was generated from the following files:

- libsswf.h
- libsswf_actions.c++