[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-dev] Re: goals for next gnash release

From: Benjamin Wolsey
Subject: [Gnash-dev] Re: goals for next gnash release
Date: Wed, 30 Sep 2009 09:04:08 +0200

> > The obstacle to both AVM2 and reentrancy is extending the Relay type
> > system to all Gnash's AS objects. This is because the most important
> > part of AVM2 initialization is to construct an object, turn it into a
> > MovieClip, and use it as the main timeline (root movie). Gnash is
> > currently incapable of turning an object into a MovieClip.
> Why wasn't this a problem in AVM1?

Because AVM1 only allows MovieClips to be created using the functions
createEmptyMovieClip() or duplicateMovieClip(), not MovieClip's
constructor, so that creating subclasses of MovieClips, TextFields,
Buttons etc is (as far as I know) not possible up to ActionScript 2.

ActionScript 3 is generally much more flexible and AVM2 has opcodes such
as CONSTRUCTSUPER and various type-casting ones, which it relies on not
only for initializing the root movie, but for most of the subsequent
objects too. CONSTRUCTSUPER is the main difficulty for now, as that is
where the main timeline object should become a MovieClip or Sprite.

The Relay system for MovieClips should have little effect on AVM1's
correctness, but there it is important for re-entrancy.

> If it's done by someone else, is it because there's a stylized way to
> start an ActionScript file? 

Every AVM2 SWF needs a main timeline, which is either a Sprite or a
MovieClip. This is provided by the SWF author, who creates subclass of
one of those classes and designates it as the main timeline. Different
compilers initialize them in different ways. 

> If so, can we make the stylized thing work,
> e.g. if they all create a "Foo" object and turn it into a MovieClip,
> let's quickly fix our Foo class so it can be turned into a MovieClip.

Any basic object needs to be able to be turned into a MovieClip, or
indeed any other type of object. This is required for most aspects of
AS3, so being able to do it for built-in types is pretty indispensible
for getting AVM2 to work properly.

Basic testing of AS3 classes is already possible with the as3compile
testsuite. It can test all classes' properties with no problems even
without being able to instantiate MovieClips properly.

> Is the Relay stuff documented anywhere?  I just looked at it in your
> recent checkin, and don't understand why it exists or what it's good
> for.  There are no comments.  Can you spend an hour writing something
> into the Gnash internals ("reference") manual about what Relay does,
> why and how it does it, where it it used today, and where it should be
> used?  Why is it even called Relay?

The ability to set an object's type (in AS3 possibly to more than one
class at a time) relies on separating the type-specific data from the C
++ structure that implements actionscript objects. The Relay class
provides this type-specific data.

Relay presumably because it relays an actionscript function call from an
actionscript object to a native class. The name comes from swfdec, which
has an older implementation of a similar system. There is some
documentation here:
as well as comments in as_object.h and Relay.h. I'll improve
documentation in Relay.h. I'd be grateful for feedback from anyone on
it; Relays are dead obvious once you know what they're for and how they
work, but it takes everyone a while to get there.

I'm working on a better reference for Gnash's core libs, so any clearer
explanations than mine would be useful.

Free Flash, use Gnash

Benjamin Wolsey, Software Developer -

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil

reply via email to

[Prev in Thread] Current Thread [Next in Thread]