gnash-dev
[Top][All Lists]
Advanced

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

Re: [Gnash-dev] [PATCH] find_target("..") error


From: Otávio Ribeiro
Subject: Re: [Gnash-dev] [PATCH] find_target("..") error
Date: Sun, 13 Aug 2006 01:13:00 -0300

On Sat, Aug 12, 2006 at 23:16  +0200, strk wrote:
What about returning 'this' instead ? Wouldn't a character with no
parent be always the root ? 

yes.. you are right!

I haven't checked the movie myself but
I think it's worth checking AS specs and do the right thing (even
warning if the ActionScript is somehow bogus).

--strk;

I read the specification and they say this:

For example, the following outline shows four sprites defined within the main file:

MainMovie.swf
    SpriteA (name: Jack)
        SpriteA1 (name: Bert)
        SpriteA2 (name: Ernie)
    SpriteB (name: Jill)

The following SetTarget paths identify the preceding sprites:

■ /Jack targets SpriteA from the main file.
■ ../ targets the main file from SpriteA.
■ /Jack/Bert targets SpriteA1 from any other sprite or the main file.
■ Bert targets SpriteA1 from SpriteA.
■ ../Ernie targets SpriteA2 from SpriteA1.
■ ../../Jill targets SpriteB from SpriteA1.


the bold one is our case!

I've made a test returning 'this' instead of the root movie clip and worked so i can conclude that they are the same (that explains the null :) ) and that the ActionScript is trying to find something before the root movie clip!

so,  bellow the patch with 'this':

=====================================start===================================

Index: server/character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/character.cpp,v
retrieving revision 1.3
diff -u -r1.3 character.cpp
--- server/character.cpp 7 Jul 2006 01:01:11 -0000 1.3
+++ server/character.cpp 13 Aug 2006 04:01:08 -0000
@@ -150,8 +150,8 @@
}
else if (name == "..")
{
- // this is possibly NULL, it seems
- return get_parent();
+ //if get_parent is NULL, this is the root movie clip
+ return (get_parent()?get_parent():this);
}
else if (name == "_level0"
     || name == "_root")

=====================================end===================================

regards,
Otávio Ribeiro




reply via email to

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