[Golist] extending PlayableBase for simple action

Moses Gunesch moses at goasap.org
Sun Jul 27 09:16:48 PDT 2008


Hm, that's a problem then.

In PlayableGroup.start(),

for (var item:Object in _children) {
	var started:Boolean = (item as IPlayable).start();
	if (started)
		listenTo(item as IPlayable);
	r = (started || r);
}

Try this instead,

for (var item:Object in _children) {
	listenTo(item as IPlayable); // first in case of immediate STOP/ 
COMPLETE.
	var started:Boolean = (item as IPlayable).start();
	if (!started)
		unListenTo(item as IPlayable);
	r = (started || r);
}

Let me know if that fixes it so that you can send COMPLETE in your  
start() method. If so I'll commit that change. :-)

-m


On Jul 27, 2008, at 1:45 AM, rboyd at telematter.com wrote:

>
> I think I stuck line 41 in there during some testing -- remove it  
> and the code exists as I intended.
>
> After some more debugging, I decided the issue was that the COMPLETE  
> event was being dispatched before the PlayableGroup had a chance to  
> set up the event listener with listenTo().
>
> I setup a Timer object to fire after 200 ms and hooked that to fire  
> COMPLETE and it's working as I intended.
>
> Thanks for the response though!
>
> -rb
>
> -------- Original Message --------
> Subject: Re: [Golist] extending PlayableBase for simple action
> From: Moses Gunesch <moses at goasap.org>
> Date: Sat, July 26, 2008 10:10 pm
> To: Mailing list for the Go ActionScript Animation Platform
> <golist at goasap.org>
>
> Could it be the return true in the first line of stop()?
>
>    public function stop():Boolean
>     {
>       return true;
> By the way, since this class only really operates on start(), maybe  
> you could just do the action and fire the COMPLETE event then... the  
> code seems a little on the complex side. Like just,
>
>     public function start():Boolean
>     {
>       dispatchEvent(new GoEvent(GoEvent.COMPLETE));
>       _target.visible = _visible;
>       return true;
>     }
>
>     public function stop():Boolean
>     { return true; }
>
>     public function pause():Boolean
>     { return false; }
>
>     public function resume():Boolean
>     { return false; }
>     public function skipTo(position:Number):Boolean
>     { return false; }
>
>
> On Jul 26, 2008, at 8:44 PM, rboyd at telematter.com wrote:
>
>>
>> Hi all,
>>
>> I'm trying to extend PlayableBase and implement IPlayable for an  
>> action that simply sets a boolean property of an object.   
>> Specifically I'm trying to set the visible property on a  
>> Papervision3D DisplayObject3D.  I don't want to override LinearGo  
>> for this purpose because I'm not really tweening anything -- I'm  
>> just flipping a Boolean.
>>
>> Here's my code: http://pastie.org/241817
>>
>> I'm adding this to PlayableGroup (which itself lives within a  
>> SequenceCA).  Anyway, the start method seems to be getting called  
>> as I can see my object become visible, but the next step within the  
>> SequenceCA never plays.  So I'm assuming that I'm not dispatching  
>> the COMPLETE event correctly or something -- but I've compared to  
>> LinearGo and SequenceBase and just can't seem to figure out where  
>> I'm going wrong.
>>
>> So now I'm asking for your help.  =)
>>
>> Thanks in advance.  Hopefully it's something really simple.
>>
>> Robert Boyd
>> Telematter, Inc.
>> rboyd at telematter.com
>> _______________________________________________
>> GoList mailing list
>> GoList at goasap.org
>> http://goasap.org/mailman/listinfo/golist_goasap.org
>
> _______________________________________________
> GoList mailing list
> GoList at goasap.org
> http://goasap.org/mailman/listinfo/golist_goasap.org
> _______________________________________________
> GoList mailing list
> GoList at goasap.org
> http://goasap.org/mailman/listinfo/golist_goasap.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://goasap.org/pipermail/golist_goasap.org/attachments/20080727/43e4e708/attachment.html 


More information about the GoList mailing list