[Dir3d-l] converting behaivors to parent script
Lucas Meijer
lucas at mach8.nl
Tue Jul 12 16:50:39 EDT 2005
Alex da Franca wrote:
>
> Am 12.07.2005 um 14:08 schrieb Duck:
>
>>
>> I was under the impression that a parent script wouldn't
>> automatically receive the normal set of director events, such as
>> 'beginsprite' and 'exitframe', and would also not be aware of any
>> particular spriteNum.
>>
>> Therefore although the script would now in principle be a parent
>> script, it wouldn't work as intended because it would receive no
>> events and would have no value for its spriteNum when instantiated
>> from a new() command... isn't this the case?
>
>
>
> the events get send to the sprites scriptinstancelist. so each object
> will receive the events.
> it is essentially as if you simply would do:
> call(#exitframe, sprite(x).scriptinstancelist)
>
> so there is no difference between a behavior and a parentscript in this
> point.
This doesn't go up for beginSprite. Only behaviours get beginSprite. Or
more correctly: only things that director puts in the scriptinstancelist
gets beginsprite. if you create a behaviour dynamically and add that to
the scriptinstance list it doesn't get beginsprite either.
Bye, Lucas
More information about the Dir3d-l
mailing list