sswf::TagButton Class Reference

#include <libsswf.h>

Inheritance diagram for sswf::TagButton:

sswf::TagBaseID sswf::TagScalingGrid sswf::TagBase sswf::MemoryManager List of all members.

Public Member Functions

VectorsActions (void)
bool AddEvent (Event *event)
 Add the specified event to the button tag.
virtual ErrorManager::error_code_t Save (Data &data)
 Pre-save all the children tags of this tag.
void SetAction (const Action &action)
void SetMenu (bool menu=true)
void SetState (const State &state)
 TagButton (TagBase *parent)
virtual swf_type_t TypeFlags (void) const
 Retrieve a set of flags desribing the type of the tag.

Private Member Functions

virtual ErrorManager::error_code_t PreSave (void)
 Pre-save all the children tags of this tag.

Private Attributes

Vectors f_actions
Vectors f_events
bool f_menu
bool f_save_button2
Vectors f_states

Constructor & Destructor Documentation

TagButton::TagButton ( TagBase parent  ) 


Member Function Documentation

Vectors & TagButton::Actions ( void   ) 

bool TagButton::AddEvent ( Event event  ) 

This function adds the specified event to the TagButton object.

An event is a set of flags which determine when the event is triggered and a set of actions to execute then.

As many events as you need can be added. However, the first event matching has its ActionScript executed and then the process stops (to be confirmed!)

Parameters:
[in] event The event to add to this TagPlace object
Returns:
This function returns true if the event is accepted as is. If the event has flags which are not compatible with the TagButton tag, then the function returns false and the event is not added.

ErrorManager::error_code_t TagButton::PreSave ( void   )  [private, virtual]

This function calls the PreSave() function of all the children unless one returns a non-zero value in which case that value will be returned and the process stopped.

This function is aumatically called by the TagHeader and TagSprite in order to pre-save their children.

The PreSave() functions are expected to be used to test whether a tag can be saved. Especially, most tags will call the MinimumVersion() function with the version required to save these tags. This ensures that you can save the entire movie in a valid SWF. Please, see the reference of each tag for more information about what their PreSave() function does.

You should not have to call this function directly.

Returns:
Zero if the PreSave() succeeds; non-zero otherwise

Reimplemented from sswf::TagBase.

ErrorManager::error_code_t TagButton::Save ( Data data  )  [virtual]

The Save() function is the one you want to call to save an SWF movie.

You may use the Save() on any tag, however, if you do so you need to properly initialize the system. For that purpose, you may want to look at the code in the TagHeader::Save(Data& data) function.

Otherwise, you simply have to call the Save() function of the TagHeader. That will save the entire movie with the smallest possible version (or fail if something cannot be saved with the present parameters.)

The TagHeader::Save() function first calls the PreSave() functions, the PreSave2ndPass() and then the Save() functions of all the children.

The other tag Save() function simply save the tag within the specified Data buffer. Note however that the TagSprite will also call the Save() function of all of its children. Yet it does not call the PreSave() functions.

The Save() function saves the movie in a Data buffer. Later you need to save that buffer on disk or some other medium.

Returns:
Zero when the Save() succeeds, non-zero if it fails
See also:
TagBase::PreSave()

TagBase::PreSave2ndPass()

Implements sswf::TagBase.

void TagButton::SetAction ( const Action action  ) 

void TagButton::SetMenu ( bool  menu = true  ) 

void TagButton::SetState ( const State state  ) 

TagBase::swf_type_t TagButton::TypeFlags ( void   )  const [virtual]

This function returns some flags that can be used to know where to place a tag in a movie, whether a tag is unique, etc.

If a tag has specifics which are not described here, it often can be checked using its name and special handling.

The existing flags are:

SWF_TYPE_DEFINE This is a definition tag (Sprite, Shape...)

SWF_TYPE_CONTROL This is a control tag (ShowFrame, PlaceObject...)

SWF_TYPE_UNIQUE This can be used once throughout the whole movie

SWF_TYPE_START This tag should be at the start of the movie

SWF_TYPE_ONE At most one per frame

SWF_TYPE_REFERENCE This tag references another

SWF_TYPE_HAS_ID This tag has an identifier

SWF_TYPE_SCRIPT This object can accept action scripts

SWF_TYPE_SPRITE This is a sprite (can include other tags)

SWF_TYPE_HEADER The header object

Note:
These flags are constant (actually hard coded!) and will not change between calls. They even rarely change between versions.
Returns:
The set of flags for the given tag
See also:
sswf::TagBase::Name(void) const

Implements sswf::TagBase.


Member Data Documentation

Vectors sswf::TagButton::f_actions [private]

Vectors sswf::TagButton::f_events [private]

bool sswf::TagButton::f_menu [private]

bool sswf::TagButton::f_save_button2 [private]

Vectors sswf::TagButton::f_states [private]


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