Jump to content
GreenSock

ftoledo

Members
  • Posts

    3
  • Joined

  • Last visited

Contact Methods

Profile Information

  • Location
    San Francisco
  • Interests
    Motion graphics, video, flash, visual effects

ftoledo's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. wow... I should probably post EOD only, instead of posting 100 times every time I found out something... I think it's working now, I missed a parent in my "e.currentTarget.content.parent.parent" I'll redo my functions and check if I can make my Frankensteinish deleteItem() method work. - ftoledo
  2. Hello again, Actually, after doing some more testing I've found out that for some reason selectItem() doesn't work either. It always returns the trace error: TransformManager Error: selectItem() and selectItems() only work with objects that have a TransformItem associated with them. Make sure you create one by calling TransformManager.addItem() before attempting to select it. If I call the method in the same function where I'm instantiating the object it works fine. The object gets instantiated and selected, such as: public function createItem():void { var object:Sprite = new Sprite(); addChild(object); _manager.addItem(object); _manager.selectItem(object); } But if I call the method outside the function, for example if I load an image and call it when the image is loaded (so that the handles are the real size of the sprite) it throws that trace error, like this: //I insantiate the object here public function createItem():void { var object:Sprite = new Sprite(); var loader:Loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded); loader.load(new URLRequest("myImage.png")); object.addChild(loader) addChild(object); _manager.addItem(object); } //And I call the selectItems method here private function imageLoaded(e:Event):void { _manager.selectItem(e.currentTarget.content.parent); //this throws the trace error } Is this a limitation or am I using the method wrong? Thank you! - ftoledo
  3. Hello Jack, First of all, I bought the TransformManager about a week ago and I am really impressed on performance and ease of use, as with all your classes. Congratulations I wanted to ask you why there isn't a deleteItem() and deleteItems() method, just as selectItem() and selectItems() work. I'm just wondering why you have to select an item first and then use deleteSelection(). You can see the handles when you try to delete an item using a function rather than the delete key for a split second. I tried modifying your class to merge selectItem and deleteSelection but for some reason it always returns the item as null, even if I dispatch the function on an object already added to the TransformManager public function deleteItem($item:*):void { var item:TransformItem = findObject($item); //makes it possible to pass in DisplayObjects or TransformItems if (item == null) { trace("TransformManager Error: deleteItem() and deleteItems() only work with objects that have a TransformItem associated with them. Make sure you create one by calling TransformManager.addItem() before attempting to select it."); } else { item.deleteObject(); } } Any ideas on how to do this? Even if I need to hide the handles that would be fine, but I can only change the handleFillColor and lineColor to uint, I can't control their alpha or visibility. Thank you! Congratulations again on this amazing class! Fernando Toledo
×