[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnash-dev] [PATCH] find_target("..") error
From: |
strk |
Subject: |
Re: [Gnash-dev] [PATCH] find_target("..") error |
Date: |
Sun, 13 Aug 2006 14:20:17 +0200 |
I've applied a sligthly modified patch, warning for
the case , please try.
--strk;
On Sun, Aug 13, 2006 at 01:13:00AM -0300, Otávio Ribeiro wrote:
> 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
>
>
>
--
/"\ ASCII Ribbon Campaign
\ / Respect for low technology.
X Keep e-mail messages readable by any computer system.
/ \ Keep it ASCII.