Why the habit of this script work?

Hello

I've used this script to make a portrait scroll bar that works perfectly, however I modified the script to work in a landscape scroll bar by altering the x and the y axis and switching on the height to the width. However a portion of it will not work... The left and right arrows are working properly but the bar scroll do not move and I for the life of me understand why.

Does anyone have any ideas as to what ive missed or done wrong?

Thanks in advance

scrolling = function () {}

var scrollWidth:Number = scrollTrack._width;

var contentWidth:Number = contentMain._width;

var scrollFaceWidth:Number = scrollFace._width;

var maskWidth:Number = maskedView._width;

var initPosition:Number = scrollFace._x = scrollTrack._x;

var initContentPos:Number = contentMain._x;

var finalContentPos:Number = maskWidth-contentWidth + initContentPos;

var left: Number = scrollTrack._y;

var top: Number = scrollTrack._x;

var right: Number = scrollTrack._y;

lower var: Number = scrollTrack._width - scrollFaceWidth + scrollTrack._x;

var dy:Number = 0;

var speed: Number = 10;

var moveVal:Number = (contentWidth-maskWidth) /(scrollWidth-scrollFaceWidth);

scrollFace.onPress = function() {}

var currPos:Number = this ._x;

startDrag (this, false, left, top, right, bottom);

this.onMouseMove = function() {}

DY = Math.abs(initPosition-this._x);

contentMain._x = Math.round(dy*-1*moveVal+initContentPos);

};

};

scrollFace.onMouseUp = function() {}

stopDrag();

delete this.onMouseMove;

};

btnUp.onPress = function() {}

this.onEnterFrame = function() {}

If (contentMain._x + speed < maskedView._x) {}

If (scrollFace._x < = high) {}

scrollFace._x = top;

} else {}

scrollFace._x = speed/moveVal;

}

contentMain._x += speed;

} else {}

scrollFace._x = top;

contentMain._x = maskedView._x;

delete this.onEnterFrame;

}

};

};

btnUp.onDragOut = function() {}

delete this.onEnterFrame;

};

btnUp.onRelease = function() {}

delete this.onEnterFrame;

};

btnDown.onPress = function() {}

this.onEnterFrame = function() {}

If (contentMain._x - speed > finalContentPos) {}

If (scrollFace._x > = bottom) {}

scrollFace._x = low;

} else {}

moveVal/scrollFace._x += speed;

}

contentMain._x = speed;

} else {}

scrollFace._x = low;

contentMain._x = finalContentPos;

delete this.onEnterFrame;

}

};

};

btnDown.onRelease = function() {}

delete this.onEnterFrame;

};

btnDown.onDragOut = function() {}

delete this.onEnterFrame;

};

If (contentWidth < maskWidth) {}

scrollFace._visible = false;

btnUp.enabled = false;

btnDown.enabled = false;

} else {}

scrollFace._visible = true;

btnUp.enabled = true;

btnDown.enabled = true;

}

};

scrolling();

Even with this reduction, it is at best a tangle of code to try to reason with him.  I think I see you have nested functions at least two levels deep, possibly further because I do not see where the original ends, and the nesting of functions is prevented best, and most often unnecessary...

scrolling = function () {}

   scrollFace.onPress = function() {}

this.onMouseMove = function() {}

}

};

};

Since you're telling the problem is that the scroll bar does not move, it does not move in relation to press the keys or does not move relative to slide.

Tags: Adobe Animate

Similar Questions

  • I have a Dell Inspiron 531, I can't Panda titanium to download when I put in the disk drive. Why the habit of this work? I don't have an error message, but my computer says that there is a threat in my computer.

    I have a Dell Inspiron 531, I can't Panda titanium to download when I put in the disk drive. Why the habit of this work? I don't have an error message, but my computer says that there is a threat in my computer.

    http://www.pandasecurity.com/homeusers/support/

    Link above is Panda Support for installation issues, etc...

    http://support.pandasecurity.com/Forum/

    Forums of users Panda at the link above.

    They will help the Panda support above links.

    See you soon.

    Mick Murphy - Microsoft partner

  • Why the habit of this work? Calling functions

    I have 3 .as classes.

    Main.As (which is my doccument Class)

    SceneSetup.as

    menu. ACE

    Main.As

    package

    {

    import flash.display.Sprite;

    import flash.display.Stage;

    SerializableAttribute public class Main extends Sprite

    {

    private var SceneSet:SceneSetup;

    public void Main()

    {

    SceneSet is addChild (new SceneSetup()) as SceneSetup;.

    }

    }

    }

    SceneSetup.as

    package

    {

    import flash.display.Sprite;

    SerializableAttribute public class SceneSetup extends Sprite

    {

    var Frame1:menu = new menu();

    var Frame2:Shop = new Shop();

    public void SceneSetup()

    {

    ChangeScene (1);

    }

    public void ChangeScene(Frame:Number) {}

    if(Frame == 1) {}

    addChild (Frame1);

    } else if(Frame == 2) {}

    addChild (Frame2);

    }

    }

    }

    }

    menu. ACE

    package

    {

    import flash.events.MouseEvent;

    import flash.display.Sprite;

    menu public class extends Sprite

    {

    var obj:SceneSetup = new SceneSetup();

    public void menu()

    {

    Start.addEventListener (MouseEvent.CLICK, startgame);

    Game.addEventListener (MouseEvent.CLICK, gameSettings);

    Ins.addEventListener (MouseEvent.CLICK, instructions);

    Arena.addEventListener (MouseEvent.CLICK, arena);

    }

    private void startgame(e:MouseEvent)

    {

    trace ("GameStarted");

    obj. ChangeScene (2);

    }

    private void gameSettings(e:MouseEvent)

    {

    trace ("gameSettings");

    }

    private void instructions(e:MouseEvent)

    {

    trace ("instructions");

    }

    private void arena(e:MouseEvent)

    {

    trace ("Arena");

    }

    Animated buttons

    //--------------------------------------------------------------------------------------- -

    }

    }

    All I want to do is to call the function in SceneSetup.as when the startgame function is triggered in menu.as

    I tried to do it with the lines, I've highlighted red.

    But this doesn't work.

    Help please!



    You should probably remove scenesetup.

    Add menu to your document class.

  • gotoAndPlay: why the habit of this work - it should be simple!

    Why does this work:

    gotoAndPlay ("CS1_2A");

    but this is not:

    var destFrame:String = "CS1_2A";
    gotoAndPlay (destFrame);

    var destFrame:String = "CS1_2A";
    _root. gotoAndPlay (destFrame);

  • Why the habit of some fonts work?

    I am new to adobe.  I need to use two specific fonts, without opening and Permian tile in my projects.  For some reason, they will appear on the screen.  Virtually every other police, with the exception of these two... anyone know why?

    I've actually updated program and now I can't see them now. Thank you!

  • Why won't this script work?

    Well so yesterday I posted a question I had with join InDesign files, I thought that I had found a solution and I was wrong. Nothing is as humbling as script... anyway the gist of what I'm trying to do is trying to combine a lot of InDesign files in a single large document. The problem I encounter is that InDesign crashes. What is strange to me is that a single iteration of this script works oddly, however when I try to do with multiple InDesign files * the bed.

    Any help on the figure, it would be much appreciated.

    System: WIndows 7

    Indy Version: CS5

    (1) selecting a folder.

    (2) get the files.

    (3) open one at a time, and duplicate pages in another document. (Which I call OCD because I basically that is what I want to do with the giant document.)

    (4) close the source file without saving the changes. Pages should not change, but better safe than sorry.

    (5) close the (TOC) destination file and save it with the new pages to this subject.

    inDesign #target

    File = Folder.selectDialog ();

    files = folder.getFiles ("*.") INDD");

    for (var i = 0; i < files.length; i ++) {}

    source_doc = app.open (files [i]);

    destination_doc = app.open (file ("c: / / users//user//desktop//TOC.indd"))

    REST();

    }

    function rest() {}

    sourcePages = source_doc.pages.itemByRange (0, -1);

    sourcePages.duplicate (LocationOptions.AFTER, destination_doc.pages.item(-1));

    source_doc. Close (SaveOptions.no);

    destination_doc. Close (SaveOptions.YES, "c://users//user//desktop//TOC.indd");

    }

    Couple of thoughts: the code is kind of a mess. I don't understand why you are opening and closing of your doc of destination with each iteration, or why you have stuff separated in another function, or why you have not any vars. As a general rule, I try to work on spreads rather than pages where possible. I avoid also itemByRange() because of the strange plural object that it returns. Here's one (in my opinion, in any case) cleaned script:

    var folder = Folder.selectDialog(),
        files = folder.getFiles("*.INDD"),
        destination_doc = app.open(new File("c://users//user//desktop//TOC.indd")),
        source_doc, i, j;
    
    for (i = 0; i < files.length; i++) {
        source_doc = app.open(files[i]);
        for (j = 0; j < source_doc.spreads.length; j++) {
            source_doc.spreads[j].duplicate(LocationOptions.AT_END, destination_doc);
        }
        source_doc.close(SaveOptions.NO);
    }
    
    destination_doc.close(SaveOptions.YES);
    

    See if you have better luck with it.

    Jeff

  • Why the command/tab does not work in the new discourse during a presentation

    Why the command/tab doesn't work with Keynote 6.6.1 during a presentation.  I can't get out (smoothly and professionally) presentation for applications that run in the background, then return smoothly.  Slows down my presentation, seems unprofessional.  This key combination worked very well until I used the new version of Keynote.

    We have no problem with the service application switcher using Yosemite and Keynote 6.6.1 on any of our client systems, or there is no record of anyone having this problem on the discussions.

    This sounds like a problem of systems;

    • what amount of RAM is installed
    • What is the amount of free space on the boot volume
    • have you antivirus, security and cleaning of installed applications
    • emptied the Recycle Bin
    • is the clear office of files and folders
  • I need to reinstall Adobe Creative Suite Production Premium on my computer, when you are prompted because it does not accept my serial number adobe, I bought my version in April of 2013, why the habit he accepts my serial number?

    Hi all, I have reinstall Adobe Creative Suite Production Premium on my computer, when you are prompted because it does not accept my serial number adobe, I bought my version in April of 2013, why the habit he accepts my serial number?

    Quickly find your serial number

    Error "serial number is not valid for this product". Creative Suite

  • Why the object_not_found exception does not work?

    Posters,

    I have the following statement in a package.procedure:

    -- (...)
    Start

    Select dbms_metadata.get_dependent_ddl ('INDEX', 'OWNER', sTableName)
    in the cDDL - clob for index DDL
    of the double
    -- (...)

    exception
    When dbms_metadata.object_not_found then
    null;

    end;
    -- (...)

    Execution is stopped in the select, not enter the exception and the following message is displayed in PL/SQL Developer MicroHelp:

    + "ORA-31608: specified object type INDEX not found." + "

    I did it another way by adding the following clause:

    -- (...)
    Start

    Select dbms_metadata.get_dependent_ddl ('INDEX', 'OWNER', sTableName)
    in the cDDL - clob for index DDL
    of the double
    where exists (select 1+)
    of all_indexes+.
    where table_owner = 'OWNER'+.
    and table_name = sTableName); +
    -- (...)

    exception
    + When no_data_found then +.
    null;

    end;
    -- (...)

    It works, but: why the object_not_found exception does not work?

    Thanks in advance for everyone!
    Philips

    Oh I just noticed:

    What happens if instead of this:

    Select dbms_metadata.get_dependent_ddl ('INDEX', 'OWNER', sTableName)
    in the cDDL - clob for index DDL
    of the double

    you say:

    cDDL: = dbms_metadata.get_dependent_ddl ('INDEX', 'OWNER', sTableName);

    ?

  • This script works under the cs5? display and if adapt to screen imported from cs3

    Hello

    I used to run this script every time that I open a photo in photoshop cs3 on xp

    now I use cs5 and windows 7

    I use this script to load the photo under the eyes and fit the image of the screen

    Image on screen adjustment

    Attach to the event Open Document in Photoshop CS 2

    // =======================================================

    var id57 = charIDToTypeID ("TPCV");

    var desc15 = new ActionDescriptor();

    var id58 = charIDToTypeID ("null");

    ref6 var = new ActionReference();

    var id59 = charIDToTypeID ("min");

    var id60 = charIDToTypeID ("MnIt");

    var id61 = charIDToTypeID ("FtOn");

    Ref6.putEnumerated (id59, id60, id61);

    desc15.putReference (id58, ref6);

    executeAction (id57, desc15, DialogModes.NO);

    //=======================================================

    id20 var = charIDToTypeID ("TPCV");

    var desc7 = new ActionDescriptor();

    id21 var = charIDToTypeID ("null");

    Ref3 var = new ActionReference();

    id22 var = charIDToTypeID ("min");

    var id23 = charIDToTypeID ("MnIt");

    var id24 = stringIDToTypeID ("screenModeFullScreenWithMenubar");

    Ref3.putEnumerated (id22, id23, id24);

    desc7.putReference (id21, ref3);

    executeAction (id20, desc7, DialogModes.NO);

    but I did notice the photo in photoshop is not very strong , I have the zoom with the mouse wheel it to be sharper

    What's wrong?

    the script is not compatible with cs5?

    is there something wrong in my setup?

    Thank you

    see you soon

    either by the way, I use another script to start photoshop

    selectTool ('handTool');

    selectTool ('handTool');

    function selectTool (tool) {}

    var desc9 = new ActionDescriptor();

    ref7 var = new ActionReference();

    Ref7.putClass (app.stringIDToTypeID (tool));

    desc9.putReference (app.charIDToTypeID ('null'), ref7);

    executeAction (app.charIDToTypeID ('slct'), desc9, DialogModes.NO);

    };

    Good Yes it works a bit strange in cs5.

    It seems to work better if the mode full screen with the menu bar is run first, then to adapt to the screen.

    Like this:

    Image on screen adjustment

    Attach to the event Open Document in Photoshop CS 2

    //=======================================================

    id20 var = charIDToTypeID ("TPCV");

    var desc7 = new ActionDescriptor();

    id21 var = charIDToTypeID ("null");

    Ref3 var = new ActionReference();

    id22 var = charIDToTypeID ("min");

    var id23 = charIDToTypeID ("MnIt");

    var id24 = stringIDToTypeID ("screenModeFullScreenWithMenubar");

    Ref3.putEnumerated (id22, id23, id24);

    desc7.putReference (id21, ref3);

    executeAction (id20, desc7, DialogModes.NO);

    // =======================================================

    var id57 = charIDToTypeID ("TPCV");

    var desc15 = new ActionDescriptor();

    var id58 = charIDToTypeID ("null");

    ref6 var = new ActionReference();

    var id59 = charIDToTypeID ("min");

    var id60 = charIDToTypeID ("MnIt");

    var id61 = charIDToTypeID ("FtOn");

    Ref6.putEnumerated (id59, id60, id61);

    desc15.putReference (id58, ref6);

    executeAction (id57, desc15, DialogModes.NO);

  • Cleaning of the appearance of this script?

    Hello I had a ton of help here for this script. I've made a few changes and was wondering if it was possible to clean underside is the image and the Script so far. I would like the script to look like the lower part of the table in this photo.  The Commander of the top edge of the page is what is really at work right now.  Any help would be greatly appreciated.

    Screen Shot 2016-05-31 at 4.45.13 PM.png

    Here's the Script.

       function doTextFrameOnPageOne()  
        
     {  
     // Name of the Text Frame The Save information is in.
        var myBlendingSettings = { blendMode : BlendMode.OVERLAY };  
        var myTransparencySettings = { blendingSettings : myBlendingSettings };   
        var doc, tf, tvINFO, ip;  
            doc = app.activeDocument;  
    // TEXT FRAME PROPERTIES        
            tf = doc.pages[0].textFrames.add({ fillColor :"Yellow", fillTint: 20, transparencySettings : myTransparencySettings, geometricBounds: ['-.75','-4.45in','1.5in','-.75in'] });
    
    // Text frame information
            ip = tf.insertionPoints;
            ip[-1].contents = "Document:"+"\t "+ doc.name  +'\r'; 
            ip[-1].contents = "User Name:" +"\t"+ getAppUserName() +'\r';
            ip[-1].contents = "Computer Name:" +"\t"+ getLogInUserName()+'\r';
            tvINFO = ip[-1].textVariableInstances.add(LocationOptions.AFTER, ip[-1]);  
            "Date Modified:" +'\t'; tvINFO.associatedTextVariable = doc.textVariables.itemByName("Modification Date");  
            ip[-1].contents = '\r';
            tvINFO = ip[-1].textVariableInstances.add(LocationOptions.AFTER, ip[-1]);  
            tvINFO.associatedTextVariable = doc.textVariables.itemByName("Output Date");  
            ip[-1].contents = '\r';  
            tvINFO = ip[-1].textVariableInstances.add(LocationOptions.AFTER, ip[-1]);  
            tvINFO.associatedTextVariable = "Date Created:" +'\t'; doc.textVariables.itemByName("Creation Date");  
      
     // Change Properties of Text Frame.:                  }  
    

    Thank you

    Alain bombaert

    It was a question essentially about the creation of a table with ExtendScript for InDesign.

    Basically, you have two options here:

    [A] convert the text in your block of text in a table

    [B] create a new table and assign the content via the content of the table property

    [A] would essentially work for you.

    But as I can see from your first screenshot that this would not work as expected, if you are remodeling your current in a table content, because you are missing the required content of a column for some lines. Of more deviding tabs. If you provide, you can use the following code:

    tf.parentStory.texts[0].convertToTable("\t","\r");
    

    [B] would cooperate with the result of your functions and methods and the necessary channels for column one and two stored in one or two paintings.

    Example:

    var columnOneContentsArray =
    [
         "Document:" ,
         "User Name:",
         "Output Date:"
    ];
    
    var columnTwoContentsArray =
    [
         "USE FOR TEST SCRIPTS.indd" ,
         "Chris Bishop" ,
         "" // Not really necessary to use an empty string, but could be used to indicate, that this cell will be empty for now.
    ];
    
    var doc = app.documents.add();
    var tf = doc.textFrames.add({geometricBounds : [0,0,"100mm","100mm"]});
    var myTable = tf.texts[0].tables.add
    (
         {
              bodyRowCount : 3 , // You could use a larger number here, even if your contents array uses less entries.
              columnCount : 2 
    
              // Use other property/value pairs to define the width of the table, stroke weights, fill color etc.pp.
              // ...
         }
    );
    
    myTable.columns[0].contents = columnOneContentsArray;
    myTable.columns[1].contents = columnTwoContentsArray;
    

    In your case you leave the content of your text variables in the columnTwoContentsArray and replace their contents with an empty string "" maybe.

    Later, after creating the table, insert you the text variable in the right cell using the first insertion point of the cell.

    var cell3OfColumn2insertionPoint1 = myTable.columns[1].cells[2].insertionPoints[0];
    var tvINFO = cell3OfColumn2insertionPoint1.textVariableInstances.add(LocationOptions.AFTER, cell3OfColumn2insertionPoint1);
    tvINFO.associatedTextVariable = doc.textVariables.itemByName("Output Date");
    

    Warning: Check, if your text variable already exists in your document.

    If so, use the existing one. If not, create a new.

    Note: I didn't test the extract with the text above variable.

    BTW. : this thread should go to the InDesign Scripting forum.

    Scripting InDesign

    Uwe

  • Why the scroll wheel does not work since version 3.6

    Since the installation of the version 4.0, there was a problem with the scroll wheel doesn't work does not correctly. Most of the time it works but sometimes the wheel stops working and is no longer made the pages up and down. At this point, I have to close the browser and reopen it.

    Have you updated your mouse drivers lately? In addition, this can happen if you spend the rendering engines using an addon like IE Tab. If you have installed IE Tab, it may need to be updated.

  • Why the keyboard commands do not work with FF v5?

    I can't get at home, end, PG. PREC, PG. Next, up arrow, Basel keys to do something sensible. I checked all my addons and extensions are all to date. This started when I upgraded from v3.x to v4.0 and made things worse with version 5.0.

    Solving problem of cursor (F7) circumflex accent

    Problems using the keys Page Up, Page Down, space bar, homeand end

    F7 to switch the power slider cursor (you want it to be turned off)

    Firefox problems & questions (Notes)

    Add the following lines to your user.js in your profile file, you create the file, it does not exist by default. You can mess up by pressing F7 accidentally, but what follows will restore the values in your prefs.js as seen in your comments: with each new session of Firefox addons.

    / / Get the SPACEBAR, PageUp, PageDown to work correctly if accidentally hit F7
    / / see http://dmcritchie.mvps.org/firefox/firefox-problems.htm#caret
    user_pref ("accessibility.browsewithcaret", false);
    user_pref ("accessibility.warn_on_browsewithcaret", true); »

    To open your folder profile and to create/update user.js to solve the problem

    1. type of topic: support in the address bar
    2. Click on the button 'Open containing folder'.
    3. Use the file menu to create a new text file,
    4. Rename "New Document file.txt" to "user.js".
    5. Open fie and paste the maps above into the file and save

    When using press F7 if you see any messages that you have restored the value to what you want, if you press once again you get a warning message use the 'No' button to keep the current settings. (Do not remove the warning)

    References:

  • Why the sidebar calendar no longer works

    Since the last update from microsft my calendar is now an orange square

    Hello

    ·         The updates have been installed on your computer?

    Method 1:

    Try to uninstall and reinstall the gadget and check if it helps. Follow the steps in this article: http://windows.microsoft.com/en-US/windows-vista/Windows-Sidebar-frequently-asked-questions

    Method 2:

    Create a new user account and check if it works: http://windows.microsoft.com/en-US/windows-vista/Create-a-user-account

    If the new works by user account can transfer files and folders to new user account: http://windows.microsoft.com/en-US/windows-vista/Fix-a-corrupted-user-profile

  • Why the YouTube widget does not work?

    I have some difficulty working with the YouTube widget. Everything worked well with her two days ago (8/18), but since yesterday it stop working. All my colleagues are facing the same thing. The test button no longer works. When you tap on all we get is a black screen with the YouTube logo on the bottom right. When I press F11 to display an overview of all works fine, but when published we get the black screen with the logo in the bottom right. What is executed that the publication of the file locally, a remote server or Adobe Acrobat Connect Pro. I am running version 9.02.421 and colleagues use this version and the previous version (9.01.xxx).

    What differs from F11 preview vs a file published? adobe.

    Please help I need a solution for this ASAP as video is the main format that I work with and have a time-sensitive project that should be displayed.

    I can confirm that the test button now does not work in the changes of URL to "youtube.googleapis.com/v/". I still Captivate installed 9.0.1.320 on a machine and the same thing happens in this YouTube widget as it is in my 9.0.2.421 install.

    A few questions for you.

    Are you an edition to the HTML5 or SWF?

    Can you confirm that the widget is the most recent version? You can do this by clicking on the blue in the Properties Panel icon when you have the widget selected in the slide.

    The version should be 17. If not you will have to remove the widget from your slide, then reinsert the Interactions of learning.

    Also, can you confirm for me that the YouTube URL uses the correct structure? It should be https://www.youtube.com/watch?v= and not the shortened structure https://youtu.be/ .

    The difference between F11 and F12 previews is F11 shows a preview using HTML5 and present F12 to preview using the Flash. The final publication should be the same as the preview of F11, if you are publishing on HTML5, but you need to run a local web server or publish the file published on a server to ensure that everything works the same. There are a few things that are happening in the published output requiring a web server in order to display correctly.

Maybe you are looking for