[Swfdec] variable scope

Nguyen Thai Ngoc Duy pclouds at gmail.com
Mon Jun 11 17:05:46 PDT 2007


On 6/11/07, Benjamin Otte <otte at gnome.org> wrote:
> 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.

Setting variables seem not that simple. The attached script was compiled with
ming 0.4.0.beta4: makeswf -v 6 -s 200x150 -r 1 -o a.swf a.as

With adobe flashplayer, I got:

Check me
inner scope
inner scope

With swfplay commit 0.4.4-377-g7246ed3 (hacked in swfdec_action_trace
to print out), I got:

SWFDEC: WARN : swfdec_as_interpret.c(571): swfdec_action_trace: TRACE: Check me
SWFDEC: WARN : swfdec_as_interpret.c(571): swfdec_action_trace: TRACE: undefined
SWFDEC: WARN : swfdec_as_interpret.c(571): swfdec_action_trace: TRACE: undefined

-- 
Duy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: a.swf
Type: application/x-shockwave-flash
Size: 127 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/swfdec/attachments/20070611/2e9f431c/attachment.swf 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: a.as
Type: application/octet-stream
Size: 191 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/swfdec/attachments/20070611/2e9f431c/attachment.obj 


More information about the Swfdec mailing list