Public Types | Public Member Functions | Protected Member Functions

gnash::MovieClip Class Reference

A MovieClip is a container for DisplayObjects. More...

#include <MovieClip.h>

Inheritance diagram for gnash::MovieClip:
Inheritance graph
[legend]
Collaboration diagram for gnash::MovieClip:
Collaboration graph
[legend]

List of all members.

Public Types

enum  PlayState { PLAYSTATE_PLAY, PLAYSTATE_STOP }
enum  VariablesMethod { METHOD_NONE = 0, METHOD_GET, METHOD_POST }
 

The various methods for sending data in requests.

More...
typedef std::map< std::string,
std::string > 
MovieVariables
typedef std::list< const
action_buffer * > 
ActionList
typedef movie_definition::PlayList PlayList

Public Member Functions

 MovieClip (as_object *object, const movie_definition *def, Movie *root, DisplayObject *parent)
 Construct a MovieClip instance.
virtual ~MovieClip ()
virtual Movieget_root () const
 Return the relative root of this DisplayObject.
virtual bool trackAsMenu ()
 ActionScript property of Buttons and MovieClips altering mouse handling.
virtual MovieClipgetAsRoot ()
 Return the _root ActionScript property of this sprite.
virtual SWFRect getBounds () const
 Get the composite bounds of all component drawing elements.
virtual bool pointInShape (boost::int32_t x, boost::int32_t y) const
 Return true if the given point falls in this DisplayObject's shape.
virtual bool pointInVisibleShape (boost::int32_t x, boost::int32_t y) const
 true if the given point falls in this DisplayObject's visible shape
virtual bool pointInHitableShape (boost::int32_t x, boost::int32_t y) const
size_t get_current_frame () const
 Return 0-based index to current frame.
size_t get_frame_count () const
size_t get_loaded_frames () const
 Return number of completely loaded frames of this sprite/movie.
size_t get_bytes_total () const
size_t get_bytes_loaded () const
const SWFRectget_frame_size () const
DSOEXPORT void setPlayState (PlayState s)
 Stop or play the sprite.
PlayState getPlayState () const
void set_background_color (const rgba &color)
virtual bool mouseEnabled () const
 Return true if we have any mouse event handlers.
virtual InteractiveObjecttopmostMouseEntity (boost::int32_t x, boost::int32_t y)
 Return the topmost entity that the given point covers that can receive mouse events. NULL if none. Coords are in parent's frame.
const DisplayObjectfindDropTarget (boost::int32_t x, boost::int32_t y, DisplayObject *dragging) const
 Point coordinates in global twips.
void setDropTarget (const std::string &tgt)
const std::string & getDropTarget () const
virtual void advance ()
 Advance to the next frame of the MovieClip.
DSOEXPORT void goto_frame (size_t target_frame_number)
 Set the sprite state at the specified frame number.
bool get_frame_number (const as_value &frame_spec, size_t &frameno) const
 Parse frame spec and return a 0-based frame number.
bool goto_labeled_frame (const std::string &label)
 Look up the labeled frame, and jump to it.
virtual void display (Renderer &renderer, const Transform &xform)
 Render this MovieClip.
void draw (Renderer &renderer, const Transform &xform)
 Draw this MovieClip.
void omit_display ()
void swapDepths (DisplayObject *ch1, int newdepth)
 Swap depth of the given DisplayObjects in the DisplayList.
DisplayObjectgetDisplayObjectAtDepth (int depth)
 Return the DisplayObject at given depth in our DisplayList.
DisplayObjectaddDisplayListObject (DisplayObject *obj, int depth)
 Attach a DisplayObject at the specified depth.
DisplayObjectadd_display_object (const SWF::PlaceObject2Tag *tag, DisplayList &dlist)
 Place a DisplayObject or mask to the DisplayList.
void move_display_object (const SWF::PlaceObject2Tag *tag, DisplayList &dlist)
 Proxy of DisplayList::moveDisplayObject().
void replace_display_object (const SWF::PlaceObject2Tag *tag, DisplayList &dlist)
 Proxy of DisplayList::replaceDisplayObject().
void remove_display_object (const SWF::PlaceObject2Tag *tag, DisplayList &dlist)
 Proxy of DisplayList::removeDisplayObject().
void remove_display_object (int depth, int)
 Remove the object at the specified depth.
void unloadMovie ()
bool attachCharacter (DisplayObject &newch, int depth, as_object *initObject)
 Attach the given DisplayObject instance to current display list.
virtual void construct (as_object *initObj=0)
 Handle placement event.
void destroy ()
 Mark this sprite as destroyed.
void add_action_buffer (const action_buffer *a)
void execute_init_action_buffer (const action_buffer &a, int cid)
 Execute the given init action buffer, if not done yet for the target DisplayObject id.
void execute_action (const action_buffer &ab)
 Execute a single action buffer (DOACTION block).
MovieClipto_movie ()
virtual void getLoadedMovie (Movie *newMovie)
 Accept a loaded Movie.
void loadVariables (const std::string &urlstr, VariablesMethod sendVarsMethod)
 Load url-encoded variables from the given url, optionally sending variables from this timeline too.
bool getTextFieldVariables (const ObjectURI &uri, as_value &val)
 Get TextField variables.
bool setTextFieldVariables (const ObjectURI &uri, const as_value &val)
 TODO: this is also unlikely to be the best way to do it.
DisplayObjectgetDisplayListObject (string_table::key name)
 Search for a named object on the DisplayList.
as_objectpathElement (string_table::key key)
 Overridden to look in DisplayList for a match.
virtual void call_frame_actions (const as_value &frame_spec)
 Execute the actions for the specified frame.
virtual void stop_drag ()
MovieClipduplicateMovieClip (const std::string &newname, int newdepth, as_object *init_object=NULL)
 Duplicate this sprite in its timeline.
virtual void notifyEvent (const event_id &id)
 Dispatch event handler(s), if any.
as_environmentget_environment ()
 Return a reference to the variable scope of this DisplayObject.
void set_textfield_variable (const std::string &name, TextField *ch)
 Set a TextField variable to this timeline.
void add_invalidated_bounds (InvalidatedRanges &ranges, bool force)
 Add the DisplayObject's invalidated bounds *to* the given ranges list.
const DisplayListgetDisplayList () const
int getNextHighestDepth () const
 Return the next highest available depth.
void setStreamSoundId (int id)
 Set the currently playing m_sound_stream_id.
void removeMovieClip ()
 Remove this sprite from the stage.
DynamicShapegraphics ()
 Direct access to the Graphics object for drawing.
virtual bool handleFocus ()
 Set focus to this MovieClip.
DSOEXPORT void setVariables (const MovieVariables &vars)
 Set all variables in the given map with their corresponding values.
virtual void enumerateNonProperties (as_environment &) const
 Enumerate child DisplayObjects.
void cleanupDisplayList ()
void queueAction (const action_buffer &buf)
 Queue the given action buffer.
void constructAsScriptObject ()
 Construct this instance as an ActionScript object.
bool getLockRoot () const
void setLockRoot (bool lr)
virtual int getDefinitionVersion () const
 Return the version of the SWF this MovieClip was parsed from.

Protected Member Functions

virtual bool unloadChildren ()
 Unload all contents in the displaylist and this instance.
virtual void markOwnResources () const
 Mark sprite-specific reachable resources.
void placeDisplayObject (DisplayObject *ch, int depth)

Detailed Description

A MovieClip is a container for DisplayObjects.

TODO: This class should inherit from Sprite In AS3 is it distinguished from a Sprite by having a timeline, i.e. more than one frame. In AS2, there is no Sprite class. There are basically two types of MovieClip: dynamic and non-dynamic. Dynamic clips are created using createEmptyMovieClip() or duplicateMovieClip(). Non-dynamic MovieClips are parsed from a SWF file. The isDynamic() member function is the only way to tell the difference (see following paragraph). The presence of a definition (the _def member) reveals whether the MovieClip was constructed with an immutable definition or not. MovieClips created using createEmptyMovieClip() have no definition. MovieClips constructed using duplicateMovieClip() have the same definition as the duplicated clip. They are "dynamic", but may have a definition! A MovieClip always has an _swf member. This is the top-level SWF (Movie) containing either the definition or the code from which the MovieClip was created. The _url member and SWF version are dependent on the _swf. Exports are also sought in this Movie.


Member Typedef Documentation

typedef std::list<const action_buffer*> gnash::MovieClip::ActionList
typedef std::map<std::string, std::string> gnash::MovieClip::MovieVariables

Member Enumeration Documentation

Enumerator:
PLAYSTATE_PLAY 
PLAYSTATE_STOP 

The various methods for sending data in requests.

Used in loadMovie, getURL, loadVariables etc.

Enumerator:
METHOD_NONE 
METHOD_GET 
METHOD_POST 

Constructor & Destructor Documentation

gnash::MovieClip::MovieClip ( as_object object,
const movie_definition def,
Movie root,
DisplayObject parent 
)

Construct a MovieClip instance.

Parameters:
def Pointer to the movie_definition this object is an instance of (may be a top-level movie or a sprite). This may be 0 if there is no immutable definition.
root The "relative" _swf of this sprite, which is the instance of top-level sprite defined by the same SWF that also contained *this* sprite definition. Note that this can be *different* from the top-level movie accessible through the VM, in case this sprite was defined in an externally loaded movie.
parent Parent of the created instance in the display list. May be 0 for top-level movies (_level#).
gnash::MovieClip::~MovieClip (  )  [virtual]

Member Function Documentation

void gnash::MovieClip::add_action_buffer ( const action_buffer a  )  [inline]

Add the given action buffer to the list of action buffers to be processed at the end of the next frame advance.

References execute_action(), and queueAction().

Referenced by gnash::SWF::DoActionTag::executeActions().

DisplayObject * gnash::MovieClip::add_display_object ( const SWF::PlaceObject2Tag tag,
DisplayList dlist 
)

Place a DisplayObject or mask to the DisplayList.

This method instantiates the given DisplayObject definition and places it on the stage at the given depth.

If the specified depth is already occupied, it results a no-ops. Otherwise, a new DisplayObject will be created and onload handler will be triggerred.

Parameters:
tag A swf defined placement tag (PlaceObject, or PlaceObject2, or PlaceObject3). No ownership transfer, the tag is still owned by the movie_definition class.
dlist The display list to add the DisplayObject to.
Returns:
A pointer to the DisplayObject being added or NULL

References gnash::DisplayObject::clear_invalidated(), draw(), and gnash::DisplayObject::transform().

Referenced by gnash::SWF::PlaceObject2Tag::executeState().

void gnash::MovieClip::add_invalidated_bounds ( InvalidatedRanges ranges,
bool  force 
) [virtual]

Add the DisplayObject's invalidated bounds *to* the given ranges list.

NOTE that this method should include the bounds that it covered the last time clear_invalidated() was called, as those need to be rerendered as well (to clear the region previously occupied by this DisplayObject).

That's why it returns the *union* of old_invalidated_ranges and the current bounds. The function is also used internally by set_invalidated() to update m_old_invalidated_ranges itself (you may notice some kind of circular reference), but that's no problem since old_invalidated_ranges is NULL during that call.

It is used to determine what area needs to be re-rendered. The coordinates are world coordinates (in TWIPS). Only instances with _invalidated flag set are checked unless force is set.

Add drawable.

Implements gnash::InteractiveObject.

DisplayObject * gnash::MovieClip::addDisplayListObject ( DisplayObject obj,
int  depth 
)

Attach a DisplayObject at the specified depth.

References _, and IF_VERBOSE_ASCODING_ERRORS.

void gnash::MovieClip::advance (  )  [virtual]

Advance to the next frame of the MovieClip.

Actions will be executed or pushed to the queue as necessary.

Reimplemented in gnash::BitmapMovie, gnash::Movie, and gnash::SWFMovie.

bool gnash::MovieClip::attachCharacter ( DisplayObject newch,
int  depth,
as_object initObject 
)

Attach the given DisplayObject instance to current display list.

Parameters:
newch The DisplayObject instance to attach.
depth The depth to assign to the instance.
Returns:
true on success, false on failure FIXME: currently never returns false !

References gnash::DisplayObjectContainer::_displayList, gnash::DisplayList::display(), gnash::DynamicShape::display(), and gnash::DynamicShape::finalize().

void gnash::MovieClip::call_frame_actions ( const as_value frame_spec  )  [virtual]

Execute the actions for the specified frame.

The frame_spec could be an integer or a string.

void gnash::MovieClip::cleanupDisplayList (  ) 

Delete DisplayObjects removed from the stage from the display lists

void gnash::MovieClip::construct ( as_object initObj = 0  )  [virtual]

Handle placement event.

This callback will (not known to be a problem):

(1) Register ourselves with the global instance list (2) Take note of our original target path (3) Register as listener of core broadcasters (4) Execute tags of frame 0

The callback will also (known to be bogus): (1) Construct this instance as an ActionScript object. See constructAsScriptObject() method, including constructing registered class and adding properties.

Reimplemented from gnash::DisplayObject.

Reimplemented in gnash::SWFMovie.

void gnash::MovieClip::constructAsScriptObject (  ) 
void gnash::MovieClip::destroy (  )  [virtual]

Mark this sprite as destroyed.

This is an override of DisplayObject::destroy()

A sprite should be destroyed when is removed from the display list and is not more needed for names (target) resolutions. Sprites are needed for names resolution whenever themselves or a contained object has an onUnload event handler defined, in which case we want the event handler to find the 'this' variable w/out attempting to rebind it.

When a sprite is destroyed, all its children are also destroyed.

Note: this function will release most memory associated with the sprite as no members or drawable should be needed anymore.

Reimplemented from gnash::DisplayObject.

void gnash::MovieClip::display ( Renderer renderer,
const Transform xform 
) [virtual]

Render this MovieClip.

Implements gnash::InteractiveObject.

References goto_frame().

void gnash::MovieClip::draw ( Renderer renderer,
const Transform xform 
)

Draw this MovieClip.

This is effectively the same as display(), but uses only the passed transform.

Referenced by add_display_object().

MovieClip * gnash::MovieClip::duplicateMovieClip ( const std::string &  newname,
int  newdepth,
as_object init_object = NULL 
)

Duplicate this sprite in its timeline.

Add the new DisplayObject at a the given depth to this sprite parent displaylist.

NOTE: the call will fail for the root movie (no parent). NOTE2: any DisplayObject at the given target depth will be replaced by the new DisplayObject NOTE3: event handlers will also be copied

Parameters:
newname Name for the copy
newdepth Depth for the copy
init_object If not null, will be used to copy properties over.

References gnash::DisplayObjectContainer::_displayList, and gnash::key::e.

void gnash::MovieClip::enumerateNonProperties ( as_environment env  )  const [virtual]

Enumerate child DisplayObjects.

See as_object::enumerateNonProperties(as_environment&) for more info.

Reimplemented from gnash::DisplayObject.

void gnash::MovieClip::execute_action ( const action_buffer ab  ) 

Execute a single action buffer (DOACTION block).

References _.

Referenced by add_action_buffer(), and getTextFieldVariables().

void gnash::MovieClip::execute_init_action_buffer ( const action_buffer a,
int  cid 
)

Execute the given init action buffer, if not done yet for the target DisplayObject id.

The action will normally be pushed on queue, but will be executed immediately if we are executing actions resulting from a callFame instead.

Parameters:
a The action buffer to execute
cid The referenced DisplayObject id

References _, and gnash::DisplayObject::getTarget().

Referenced by gnash::SWF::DoInitActionTag::executeState().

const DisplayObject * gnash::MovieClip::findDropTarget ( boost::int32_t  x,
boost::int32_t  y,
DisplayObject dragging 
) const [virtual]

Point coordinates in global twips.

Find highest depth DisplayObject whose shape contains the given point and is not the DisplayObject being dragged or any of its childs.

Reimplemented from gnash::DisplayObject.

size_t gnash::MovieClip::get_bytes_loaded (  )  const [inline]

Return number of loaded bytes in the movie (not sprite!)

References gnash::DisplayObject::isDynamic().

size_t gnash::MovieClip::get_bytes_total (  )  const [inline]

Return total number of bytes in the movie (not sprite!)

References gnash::DisplayObject::isDynamic().

size_t gnash::MovieClip::get_current_frame (  )  const [inline]

Return 0-based index to current frame.

Referenced by gnash::Gui::advanceMovie(), main(), and testAll().

as_environment& gnash::MovieClip::get_environment (  )  [inline, virtual]

Return a reference to the variable scope of this DisplayObject.

TODO: make const/return const& ?

Reimplemented from gnash::DisplayObject.

size_t gnash::MovieClip::get_frame_count (  )  const [inline]
bool gnash::MovieClip::get_frame_number ( const as_value frame_spec,
size_t &  frameno 
) const

Parse frame spec and return a 0-based frame number.

If frame spec cannot be converted to !NAN and !Infinity number it will be converted to a string and considered a frame label (returns false if referring to an unknwown label).

Parameters:
frame_spec The frame specification.
frameno The evaluated frame number (0-based)
Returns:
True if the frame_spec could be resolved to a frame number. False if the frame_spec was invalid.
const SWFRect& gnash::MovieClip::get_frame_size (  )  const [inline]
size_t gnash::MovieClip::get_loaded_frames (  )  const [inline]

Return number of completely loaded frames of this sprite/movie.

Note: the number is also the last frame accessible (frames numberes are 1-based)

Referenced by pointInShape().

Movie * gnash::MovieClip::get_root (  )  const [virtual]

Return the relative root of this DisplayObject.

The "relative" is the Movie created by the same SWF definition that contained the definition of this DisplayObject.

The default implementation is to invoke get_root against this DisplayObject's parent.

Reimplemented from gnash::DisplayObject.

Referenced by gnash::SWF::ImportAssetsTag::executeState(), gnash::SWF::ExportAssetsTag::executeState(), gnash::SWF::DefinitionTag::executeState(), and main().

MovieClip * gnash::MovieClip::getAsRoot (  )  [virtual]

Return the _root ActionScript property of this sprite.

Relative or absolute is determined by the _lockroot property, see getLockRoot and setLockRoot. May return this.

Reimplemented from gnash::DisplayObject.

References gnash::key::e, gnash::for_each(), gnash::key::i, and gnash::GcResource::setReachable().

SWFRect gnash::MovieClip::getBounds (  )  const [virtual]

Get the composite bounds of all component drawing elements.

Implements gnash::InteractiveObject.

int gnash::MovieClip::getDefinitionVersion (  )  const [virtual]

Return the version of the SWF this MovieClip was parsed from.

Reimplemented from gnash::DisplayObject.

Referenced by gnash::TextField::getDefinitionVersion().

const DisplayList& gnash::MovieClip::getDisplayList (  )  const [inline]
DisplayObject * gnash::MovieClip::getDisplayListObject ( string_table::key  name  ) 

Search for a named object on the DisplayList.

These are properties, but not attached as genuine members to the MovieClip object. They take priority over DisplayObject magic properties and inherited properties, but not over own properties.

Parameters:
name The name of the object. This function handles case-sensitivity.
Returns:
The object if found, otherwise 0.
DisplayObject * gnash::MovieClip::getDisplayObjectAtDepth ( int  depth  ) 

Return the DisplayObject at given depth in our DisplayList.

Returns:
NULL if the specified depth is available (no chars there)

References gnash::deleteChecked().

const std::string& gnash::MovieClip::getDropTarget (  )  const [inline]
void gnash::MovieClip::getLoadedMovie ( Movie newMovie  )  [virtual]

Accept a loaded Movie.

Reimplemented from gnash::DisplayObject.

bool gnash::MovieClip::getLockRoot (  )  const [inline]

Return true if getAsRoot() should return the *relative* root, false otherwise.

int gnash::MovieClip::getNextHighestDepth (  )  const [inline]

Return the next highest available depth.

Placing an object at the depth returned by this function should result in a DisplayObject that is displayd above all others

References gnash::DisplayObjectContainer::_displayList, and gnash::DisplayList::getNextHighestDepth().

PlayState gnash::MovieClip::getPlayState (  )  const [inline]

Referenced by main(), and testAll().

bool gnash::MovieClip::getTextFieldVariables ( const ObjectURI uri,
as_value val 
)

Get TextField variables.

This handles special properties of MovieClip.

TODO: this is unlikely to be the best way of doing it, and it would simplify things if this function could be dropped.

The only genuine special properties are DisplayList members. These are accessible as properties and are enumerated, but not ownProperties of a MovieClip. The TextField variables should probably be handled in a more generic way.

References execute_action().

void gnash::MovieClip::goto_frame ( size_t  target_frame_number  ) 

Set the sprite state at the specified frame number.

0-based frame numbers!! (in contrast to ActionScript and Flash MX)

Referenced by display().

bool gnash::MovieClip::goto_labeled_frame ( const std::string &  label  ) 

Look up the labeled frame, and jump to it.

DynamicShape& gnash::MovieClip::graphics (  )  [inline]

Direct access to the Graphics object for drawing.

References gnash::DisplayObject::set_invalidated().

bool gnash::MovieClip::handleFocus (  )  [virtual]

Set focus to this MovieClip.

Returns:
true if this MovieClip can receive focus.

Reimplemented from gnash::DisplayObject.

void gnash::MovieClip::loadVariables ( const std::string &  urlstr,
VariablesMethod  sendVarsMethod 
)

Load url-encoded variables from the given url, optionally sending variables from this timeline too.

A LoadVariablesThread will be started to load and parse variables and added to the _loadVariableRequests. Then, at every advance_sprite any completed threads will be processed (see processCompletedLoadVariableRequests)

NOTE: the given url will be security-checked

Parameters:
urlstr,: The url to load variables from.
sendVarsMethod,: The VariablesMethod to use. If METHOD_NONE, no data will be sent.
void gnash::MovieClip::markOwnResources (  )  const [protected, virtual]

Mark sprite-specific reachable resources.

sprite-specific reachable resources are:

Canvas for dynamic drawing (_drawable)

  • sprite environment
  • definition the sprite has been instantiated from
  • Textfields having an associated variable registered in this instance.
  • Relative root of this instance (_swf)

Reimplemented from gnash::DisplayObject.

bool gnash::MovieClip::mouseEnabled (  )  const [virtual]

Return true if we have any mouse event handlers.

NOTE: this function currently does not consider general mouse event handlers MOUSE_MOVE, MOUSE

Implements gnash::InteractiveObject.

References gnash::DisplayObjectContainer::_displayList, gnash::DisplayObject::visible(), and gnash::DisplayList::visitAll().

void gnash::MovieClip::move_display_object ( const SWF::PlaceObject2Tag tag,
DisplayList dlist 
)
void gnash::MovieClip::notifyEvent ( const event_id id  )  [virtual]

Dispatch event handler(s), if any.

Reimplemented from gnash::DisplayObject.

Referenced by setVariables().

void gnash::MovieClip::omit_display (  )  [virtual]

Called instead of display() when the DisplayObject is not visible on stage. Used to clear the invalidated flags.

Reimplemented from gnash::DisplayObject.

as_object * gnash::MovieClip::pathElement ( string_table::key  key  )  [virtual]

Overridden to look in DisplayList for a match.

Reimplemented from gnash::DisplayObject.

void gnash::MovieClip::placeDisplayObject ( DisplayObject ch,
int  depth 
) [inline, protected]
bool gnash::MovieClip::pointInHitableShape ( boost::int32_t  x,
boost::int32_t  y 
) const [virtual]

return true if the given point is located in a(this) hitable sprite.

all sprites except mouse-insensitive dynamic masks are hitable. _visible property is ignored for hitable DisplayObjects.

bool gnash::MovieClip::pointInShape ( boost::int32_t  x,
boost::int32_t  y 
) const [virtual]

Return true if the given point falls in this DisplayObject's shape.

Point coordinates are in world TWIPS

The default implementation warns about a missing override and invokes pointInBounds().

Reimplemented from gnash::InteractiveObject.

References get_loaded_frames().

bool gnash::MovieClip::pointInVisibleShape ( boost::int32_t  x,
boost::int32_t  y 
) const [virtual]

true if the given point falls in this DisplayObject's visible shape

Point coordinates are in world TWIPS

The default implementation returns false if the DisplayObject is not visible, calling pointInShape() otherwise.

Note that this is good for simple DisplayObjects but needs to be overridden for DisplayObjects with childs. When a DisplayObject has childs it must take into account the case in which some childs are visible and some are not.

Reimplemented from gnash::DisplayObject.

void gnash::MovieClip::queueAction ( const action_buffer buf  ) 

Queue the given action buffer.

The action will be pushed on the current global list (see movie_root).

Referenced by add_action_buffer().

void gnash::MovieClip::remove_display_object ( int  depth,
int   
)

Remove the object at the specified depth.

NOTE: (1)the id parameter is currently unused, but required to avoid breaking of inheritance from movie.h. (2)the id might be used for specifying a DisplayObject in the depth(think about multiple DisplayObjects within the same depth, not tested and a rare case)

void gnash::MovieClip::remove_display_object ( const SWF::PlaceObject2Tag tag,
DisplayList dlist 
)
void gnash::MovieClip::removeMovieClip (  ) 

Remove this sprite from the stage.

This function is intended to be called by effect of a removeMovieClip() ActionScript call and implements the checks required for this specific case.

Callers are:

The removal will not occur if the depth of this DisplayObjects is not in the "dynamic" range [0..1048575] as described at the following URL:

http://www.senocular.com/flash/tutorials/depths/?page=2

A testcases for this behaviour can be found in

testsuite/misc-ming.all/displaylist_depths_test.swf

References gnash::LoadVariablesThread::completed().

void gnash::MovieClip::replace_display_object ( const SWF::PlaceObject2Tag tag,
DisplayList dlist 
)
void gnash::MovieClip::set_background_color ( const rgba color  ) 
void gnash::MovieClip::set_textfield_variable ( const std::string &  name,
TextField ch 
)

Set a TextField variable to this timeline.

A TextField variable is a variable that acts as a setter/getter for a TextField 'text' member.

References gnash::DisplayObject::stage(), and gnash::movie_root::stop_drag().

void gnash::MovieClip::setDropTarget ( const std::string &  tgt  )  [inline]
void gnash::MovieClip::setLockRoot ( bool  lr  )  [inline]

Set whether getAsRoot() should return the *relative* root, false otherwise. True for relative root.

void gnash::MovieClip::setPlayState ( PlayState  s  ) 

Stop or play the sprite.

If stopped, any stream sound associated with this sprite will also be stopped.

void gnash::MovieClip::setStreamSoundId ( int  id  ) 

Set the currently playing m_sound_stream_id.

Referenced by gnash::SWF::StreamSoundBlockTag::executeActions().

bool gnash::MovieClip::setTextFieldVariables ( const ObjectURI uri,
const as_value val 
)

TODO: this is also unlikely to be the best way to do it.

void gnash::MovieClip::setVariables ( const MovieVariables vars  ) 

Set all variables in the given map with their corresponding values.

References gnash::event_id::DATA, and notifyEvent().

void gnash::MovieClip::stop_drag (  )  [virtual]
void gnash::MovieClip::swapDepths ( DisplayObject ch1,
int  newdepth 
) [inline]

Swap depth of the given DisplayObjects in the DisplayList.

See DisplayList::swapDepths for more info

References gnash::DisplayObjectContainer::_displayList, and gnash::DisplayList::swapDepths().

MovieClip* gnash::MovieClip::to_movie (  )  [inline, virtual]

Reimplemented from gnash::DisplayObject.

Referenced by main().

InteractiveObject * gnash::MovieClip::topmostMouseEntity ( boost::int32_t  x,
boost::int32_t  y 
) [virtual]

Return the topmost entity that the given point covers that can receive mouse events. NULL if none. Coords are in parent's frame.

Implements gnash::InteractiveObject.

bool gnash::MovieClip::trackAsMenu (  )  [virtual]

ActionScript property of Buttons and MovieClips altering mouse handling.

Reimplemented from gnash::InteractiveObject.

bool gnash::MovieClip::unloadChildren (  )  [protected, virtual]

Unload all contents in the displaylist and this instance.

Return true if there was an unloadHandler.

Reimplemented from gnash::DisplayObject.

References _, gnash::DisplayObject::getTarget(), gnash::movie_root::PRIORITY_CONSTRUCT, gnash::movie_root::pushAction(), and gnash::DisplayObject::stage().

void gnash::MovieClip::unloadMovie (  ) 

Remove the 'contents' of the MovieClip, but leave properties and event handlers intact.


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