[Swfdec] variable scope

Benjamin Otte otte at gnome.org
Mon Jun 11 09:08:30 PDT 2007


On 6/11/07, Nguyen Thai Ngoc Duy <pclouds at gmail.com> wrote:
> I have a feeling that SetVariable always sets undefined variables on
> the current frame (cx->frame->var_object).
>
I prefer tests to feelings. ;)
I'm also not sure that this is correct inside user-defined functions.

> Got an article here [1]. There are differences between flash 5 and
> flash mx (flash 6?) in the way new variables are created. So I guess
> everything works fine (for flash 5). I just hit the edge because I
> played with a flash 6 script. There is a sentence "Because Flash looks
> for a variable called myVar in the timeline of the movie clip,..." in
> the article. What variable in swfdec is "timeline of the movie clip"?
>
The difference for Flash 5 and Flash 6 that he is talking about is
implemented in swfdec_action_define_function(), line 1442 and tested
in the function-scope*.swf tests. As far as I can see, those stuff is
only about accessing variables, as the setting of the variables is
always pretty simple.

A "timeline" btw is something that is not represented in the format.
It's what people mean, when they talk about the UI. See for example
[1] for screenshots of Flash MX that have the timeline.
As far as I have understood it, people think of a timeline as a sprite
instance (think SwfdecSpriteMovie) that modifies its contents while
running.

Benjamin

[1] http://www.codeweavers.com/compatibility/browse/name/?app_id=80;screenshot=1


More information about the Swfdec mailing list