[Golist] OverlapMonitor and "locking" a tween

Moses Gunesch moses at goasap.org
Fri Apr 4 18:49:54 PDT 2008


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://goasap.org/pipermail/golist_goasap.org/attachments/20080404/8c9c6418/attachment.html 


More information about the GoList mailing list