Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

Nezarov

Members
  • Posts

    8
  • Joined

  • Last visited

Posts posted by Nezarov

  1. Yes it's working thanks, I have another question plz can you explain me how move() method works? I want to move all the selected items by a button click I am using:

     

    transform_tool.selectedTargetObjects.move(10,10,flase, false); this code doesn't work i am getting an error says "move is not a function" I tried so many codes but no one of them has worked! I can only move one selected item on x and y axis's using: transform_tool.selectedTargetObjects[0].x

    what I am looking for is to move all the selectedItems depending on the dummyBox, is there any solution? Thanks.

  2. Hello, I am trying to remove some items from the taregetObjects list using array but it's removing only one item!

     

    Code sample:

    var my_item:TransformItem = t_manager.addItem(my_mc);
    my_item.addEventListener(TransformEvent.SELECT, addToList);
    function addToList(event:TransformEvent):void
    {
        selectedArray = new Array;
        for (var t:int = 0; t<t_manager.selectedTargetObjects.length; t++)
        {
            selectedArray.push(t_manager.selectedTargetObjects[t]);
        }
        ///selectedArray = t_manager.selectedTargetObjects;
        ///selectedArray = t_manager.selectedItems;
    }
    
    //// Remove items from targetObjects array:
    
    index = 0
    for(var i:int = 0; i< selectedArray.length; i++)
     {
     ///////// some code here
     index++
     //trace(index) // output: 4
      if (index == selectedArray.length)
      {
      for (var t:int = 0; t < index; t++)
       {
         t_manager.removeItem(selectedArray[i]);
       }
      }
     }
    it's removing one item only!
  3. Thank you..

    Actually I solved it but that was not easy because there's about 5000 lines of a code :|

     

    TransformManager.as:

    private static function onKeyPress($e:KeyboardEvent):void {
                _keysDown[$e.keyCode] = true;
                if ($e.keyCode == Keyboard.DELETE || (_keysDown[Keyboard.SHIFT] && _keysDown[Keyboard.BACKSPACE])) {
    

    TransformItem.as:

     public function onPressDelete($e:Event = null, $allowSelectableTextDelete:Boolean = false):Boolean {
                            if (_enabled && _allowDelete /*&& (_hasSelectableText == false || $allowSelectableTextDelete)*/) {

    That's all.

    • Like 1
  4. Hi, I am trying to edit the "onKeyPress" function to allow deleting the text fields by pressing two keys (Shift & Backspace),

    private static function onKeyPress($e:KeyboardEvent):void {
    _keysDown[$e.keyCode] = true;
    if ($e.keyCode == Keyboard.DELETE || _keysDown[Keyboard.SHIFT] && _keysDown[Keyboard.BACKSPACE])
    ...
    

    The code above will not work unless I set the "hasSelectableText" Boolean to false:
     

    newVars.hasSelectableText = ($targetObject is TextField) ? false : $hasSelectableText;
    

    But now I am not able to highlight the text! how to solve that please? can you point me to the line where I can set the selected object as a text field or "hasSelectableText"?

    Or if I added the text field inside a movieClip is there any way to use "SCALE_WIDTH_AND_HEIGHT" function instead of the normal scale mode? Thanks.

×