sswf::ActionWaitForFrame Class Reference

Create an action used to wait for a frame to be loaded. More...

#include <libsswf.h>

Inheritance diagram for sswf::ActionWaitForFrame:

sswf::Action sswf::MemoryManager sswf::ItemBase sswf::MemBuffer List of all members.

Public Member Functions

 ActionWaitForFrame (TagBase *tag, action_t action=ACTION_WAIT_FOR_FRAME)
 Initialize the ActionWaitForFrame object.
void AddAction (Action *action)
 Add a sub-action to the wait frame action.
void SetFrameName (const char *name)
 Set the name of the frame to wait for.
virtual VectorsSubList (void)
 Return the Vectors holding the sub-actions.

Private Member Functions

virtual ActionDuplicate (void) const
 Create a clone of this action.
virtual ErrorManager::error_code_t SaveData (Data &data, Data &nested_data)
 Save the extraneous data of the ActionWaitForFrame object.

Private Attributes

Vectors f_actions
char * f_frame_name

Detailed Description

This class creates an action one can use to wait for a certain frame to be saved. As long as that frame is not loaded, the sub-actions are skipped. Once the frame was loaded, the actions are executed. These actions can result in the execution of the rest of the movie.

Warning:
The WaitForFrame action uses a byte to define the number of the sub-actions to skip. That means a maximum of 255 actions, which is relatively small for an ActionScript. In general, you can bypass the problem by calling a function.
Note:
This is 255 actions. Thus in bytes it can be much larger. However, do NOT try to define a function or an object within this block. It is likely to fail.
Bug:
It could be that the ACTION_WAIT_FOR_FRAME and ACTION_WAIT_FOR_FRAME2 should each have its own class since the dynamic version should not be given a frame name (it is taken dynamically!). On the other hand it could be that I could change the code and if you define a frame name then I force the ACTION_WAIT_FOR_FRAME and by default I would use ACTION_WAIT_FOR_FRAME2. In this latter case, I would need a PreSave() to determine the action before to save the result.
See also:
SWF Alexis' Reference—Wait For Frame

SWF Alexis' Reference—Wait For Frame (dynamic)


Constructor & Destructor Documentation

ActionWaitForFrame::ActionWaitForFrame ( TagBase tag,
action_t  action = ACTION_WAIT_FOR_FRAME 
)

This constructor initializes the ActionWaitForFrame object with a frame with no name and no actions.

The action parameter can be set to:

ACTION_WAIT_FOR_FRAME ACTION_WAIT_FOR_FRAME2

Parameters:
[in] tag The tag in which this action is being added
[in] action One of the wait for action codes


Member Function Documentation

void ActionWaitForFrame::AddAction ( Action action  ) 

This function adds a sub-action to execute once the movie loaded the specified frame.

You can also access the list of sub-actions using the sswf::ActioWaitForFrame::SubList() function.

Note that the total number of these actions is 255 (and not 255 bytes!) This makes it difficult to read this action.

Parameters:
[in] action The action to append to this wait for frame

Action * ActionWaitForFrame::Duplicate ( void   )  const [private, virtual]

This function creates a new ActionWaitForFrame and copies the frame name and all the sub-actions in it. Finally, it returns the pointer of the new action.

Returns:
The pointer of the clone action

Reimplemented from sswf::Action.

ErrorManager::error_code_t ActionWaitForFrame::SaveData ( Data data,
Data nested_data 
) [private, virtual]

This function saves the frame number (ACTION_WAIT_FOR_FRAME) and the number of nested actions.

If the specified frame is not found or no frame name is specified for an ACTION_WAIT_FOR_FRAME, then an error results.

Parameters:
[in] data The Data buffer where the information is saved
[in] nested_data The Action::Save() function defines this buffer, this function does not need it since the size is not what is saved in these actions

Reimplemented from sswf::Action.

void ActionWaitForFrame::SetFrameName ( const char *  frame_name  ) 

In case you used ACTION_WAIT_FOR_FRAME, this is the name of the frame to wait for.

Parameters:
[in] frame_name The name of the frame to wait for

Vectors * ActionWaitForFrame::SubList ( void   )  [virtual]

This function is used to retrieve the pointer of the Vectors used to register all the sub-actions of this ActionWaitForFrame object.

Returns:
The Vectors pointers of the sub-actions

Reimplemented from sswf::Action.


Member Data Documentation

Vectors sswf::ActionWaitForFrame::f_actions [private]

char* sswf::ActionWaitForFrame::f_frame_name [private]


The documentation for this class was generated from the following files:
Generated on Sun May 13 23:29:39 2007 for libsswf by  doxygen 1.4.7