[Golist] OverlapMonitor and "locking" a tween

Moses Gunesch moses at goasap.org
Sat Apr 5 09:41:21 PDT 2008


It's a bit confusing to me. Is the issue that you want to be able to  
make a tween object "restart" when start() is called, but somehow  
OverlapMonitor is killing the tween when you do that?

Actually this could potentially also be a weirdness in LInearGo, since  
restarting an active tween doesn't necessarily need to call stop() and  
remove it from the engine, then add it back to the engine. Maybe  
that's what's causing it...


On Apr 5, 2008, at 4:32 AM, Robert Sköld wrote:
> Thanks, altough i did figure out a much better way to "lock" those
> tweens. Instead of messing with the manager parts (which works great
> for it's own purpose btw) I've just overidden the stop method, and
> just let it return false unless it's complete (or the variable locked
> is false).
>
> example:
> 		override public function stop() : Boolean {
> 			return ( _locked && !_complete ) ? false : super.stop();
> 		}
>
> I totally stared myself blind at first at the overlapmonitor, but i
> must say it works great!
>
> So thanks for Go! :)
>
> /bob
>
> On Apr 5, 2008, at 03:49, Moses Gunesch wrote:
>> I dunno that's a tough one... personally I wouldn't guess that
>> anything is a common issue yet, I haven't seen many people dabbling
>> in manager mechanics so far. I'm excited to see what you come up
>> with though and once I get this writing thing out of the way I'll
>> help you debug if need be.
>> - m
>>
>>
>> On Apr 3, 2008, at 5:29 AM, Robert Sköld wrote:
>>
>>> Hey all!
>>>
>>> First of all, i've manage to "fix" the tweens i had issues with
>>> earlier by using the OverlapMonitor instead of the self-made hack i
>>> did. It works great, but...
>>>
>>> I'm trying to add a "locking" feature to the tweens, so that if they
>>> have locked="true" as an attribute (it's an xml-based parser) it's
>>> not
>>> supposed to be "overridden" by the OverlapMonitor and other newer
>>> tweens.
>>> And it's working somewhat ok, besides when the tween that overlaps
>>> the
>>> "locked" tween is the same as the "locked" tween.
>>> For example: if the same tween is ran twice by clicking the same
>>> button. Then the tween "restarts" but from the same position, but
>>> with
>>> the same duration. But not if i have another tween started from
>>> another button which overlaps with the running "locked" tween.
>>>
>>> One problem seems to be that if the tween is the same as an already
>>> running tween it is stopped/removed even before it's "managed", so
>>> there's no way to stop it from being overridden.
>>>
>>> I'm sure this must be a common issue, so any suggestions on how to
>>> solve this?
>>>
>>>
>>>
>>> Some code (the IManageable part) from my Animate class (the rest is
>>> more or less the tutorial, but with some color transformation  
>>> stuff):
>>>
>>> 		public function getActiveTargets() : Array {
>>> 			return [ target ];
>>> 		}
>>> 		public function getActiveProperties() : Array {
>>> 			return _properties;
>>> 		}
>>>
>>> 		public function isHandling( properties : Array , handler :
>>> IManageable ) : Boolean {
>>> 			return properties.every( hasProperty );
>>> 		}
>>> 		
>>> 		private function hasProperty( property : Property , index : int ,
>>> arr : Array ) : Boolean {
>>> 			for each( var prop : Property in _properties ) // Property is a
>>> local class with name,start,change and end properties.
>>> 				if( prop.name == property.name )
>>> 					return true;
>>> 			return false;
>>> 		}
>>>
>>> 		public function releaseHandling( ...params ) : void {
>>> 			var handler : Animate = params[0] as Animate; // added the
>>> parameter in OverlapMonitor.reserve();
>>> 			if( _locked ) {
>>> 				// Since the handler didn't start yet, we need to remove it
>>> instead of stopping it.
>>> 				trace( "Handler removed: " + GoEngine.removeItem( handler ) ,
>>> "id:" + handler.id );
>>> 			} else {
>>> 				trace( "Target stop: " + stop() , "for" , this.id );
>>> 			}
>>> 		}
>>>
>>>
>>> Any help would be much appreciated!
>>>
>>> / bob
>>>
>>>
>>> _______________________________________________
>>> 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/20080405/e2d06bf7/attachment.html 


More information about the GoList mailing list