Z-index/depth to layers

I am recently working on a website with drop down menus. When I add another layer to the page, the drop down menus are below the new layer therefore hiding them to the user. I tried using the z-index numbers but they don't seem to be working. Any help would be greatly appreciated.
Thanks,
Tara

Tara, it's not possible to help without seeing your code. I can, however,
GUESS what might be happening. I'm thinking that the submenus (with their
z-index) are contained within a parent menu container (with its z-index).
When you have a nested situation like this, the descendent z-idices are all
only effective within the context of the parent z-index. In other words, if
the parent's z-index is 1, then a submenu with a z-index of 5000 will be
higher than any other submenu with a z-index less than 5000, but will still
only be considered to have a z-index of 1 vis-a-vis the page itself. Thus,
adjusting the submenu z-index values will only affect the behavior inside
the parent. To move the menu 'closer to the top', you'd have to adjust the
parent's z-index.
Make sense? It's completely hypothetical, though.
Murray

Similar Messages

  • Can an item of 1 Bit depth have layers?

    Can an item of 1 Bit depth have layers which can be copied or duplicated.  My 1 Bit item is partially locked and the layer menu does not permit any operations.

    jaysachs wrote:
    Does a Black/white item have a 1 Bit depth?
    Yes. One bit binary is either on/off = black/white.
    Cheers,
    Neale
    Insanity is hereditary, you get it from your children
    If this post or another user's post resolves the original issue, please mark the posts as correct and/or helpful accordingly. This helps other users with similar trouble get answers to their questions quicker. Thanks.

  • Index size keep growing while table size unchanged

    Hi Guys,
    I've got some simple and standard b-tree indexes that keep on acquiring new extents (e.g. 4MB per week) while the base table size kept unchanged for years.
    The base tables are some working tables with DML operation and nearly same number of records daily.
    I've analysed the schema in the test environment.
    Those indexes do not fulfil the criteria for rebuild as follows,
    - deleted entries represent 20% or more of the current entries
    - the index depth is more then 4 levels
    May I know what cause the index size keep growing and will the size of the index reduced after rebuild?
    Grateful if someone can give me some advice.
    Thanks a lot.
    Best regards,
    Timmy

    Please read the documentation. COALESCE is available in 9.2.
    Here is a demo for coalesce in 10G.
    YAS@10G>truncate table t;
    Table truncated.
    YAS@10G>select segment_name,bytes from user_segments where segment_name in ('T','TIND');
    SEGMENT_NAME              BYTES
    T                         65536
    TIND                      65536
    YAS@10G>insert into t select level from dual connect by level<=10000;
    10000 rows created.
    YAS@10G>commit;
    Commit complete.
    YAS@10G>
    YAS@10G>select segment_name,bytes from user_segments where segment_name in ('T','TIND');
    SEGMENT_NAME              BYTES
    T                        196608
    TIND                     196608We have 10,000 rows now. Let's delete half of them and insert another 5,000 rows with higher keys.
    YAS@10G>delete from t where mod(id,2)=0;
    5000 rows deleted.
    YAS@10G>commit;
    Commit complete.
    YAS@10G>insert into t select level+10000 from dual connect by level<=5000;
    5000 rows created.
    YAS@10G>commit;
    Commit complete.
    YAS@10G>select segment_name,bytes from user_segments where segment_name in ('T','TIND');
    SEGMENT_NAME              BYTES
    T                        196608
    TIND                     327680Table size is the same but the index size got bigger.
    YAS@10G>exec show_space('TIND',user,'INDEX');
    Unformatted Blocks .....................               0
    FS1 Blocks (0-25)  .....................               0
    FS2 Blocks (25-50) .....................               6
    FS3 Blocks (50-75) .....................               0
    FS4 Blocks (75-100).....................               0
    Full Blocks        .....................              29
    Total Blocks............................              40
    Total Bytes.............................         327,680
    Total MBytes............................               0
    Unused Blocks...........................               0
    Unused Bytes............................               0
    Last Used Ext FileId....................               4
    Last Used Ext BlockId...................          37,001
    Last Used Block.........................               8
    PL/SQL procedure successfully completed.We have 29 full blocks. Let's coalesce.
    YAS@10G>alter index tind coalesce;
    Index altered.
    YAS@10G>select segment_name,bytes from user_segments where segment_name in ('T','TIND');
    SEGMENT_NAME              BYTES
    T                        196608
    TIND                     327680
    YAS@10G>exec show_space('TIND',user,'INDEX');
    Unformatted Blocks .....................               0
    FS1 Blocks (0-25)  .....................               0
    FS2 Blocks (25-50) .....................              13
    FS3 Blocks (50-75) .....................               0
    FS4 Blocks (75-100).....................               0
    Full Blocks        .....................              22
    Total Blocks............................              40
    Total Bytes.............................         327,680
    Total MBytes............................               0
    Unused Blocks...........................               0
    Unused Bytes............................               0
    Last Used Ext FileId....................               4
    Last Used Ext BlockId...................          37,001
    Last Used Block.........................               8
    PL/SQL procedure successfully completed.The index size is still the same but now we have 22 full and 13 empty blocks.
    Insert another 5000 rows with higher key values.
    YAS@10G>insert into t select level+15000 from dual connect by level<=5000;
    5000 rows created.
    YAS@10G>commit;
    Commit complete.
    YAS@10G>select segment_name,bytes from user_segments where segment_name in ('T','TIND');
    SEGMENT_NAME              BYTES
    T                        262144
    TIND                     327680Now the index did not get bigger because it could use the free blocks for the new rows.

  • Rebuild indexes?

    I am working with a large scale database with approximately 100 tables where some tables grow with 100-500 million rows per year. The performance in of the system is fairly good but I was wondering if anyone has any input regarding how often indexes should be rebuilt?
    Kind regards,
    Sumpen

    martinmorono wrote:
    Inside my company, We are using this self-made rules to consider an index as candidate to be rebuild:
    Index is considered as candidate for rebuild when :
    - when deleted entries represent 20% or more of the current entries
    - when the index depth is more then 4 levels.(height starts counting from 1 so > 5)
    - Index is (possible) candidate for a bitmap index when :
    - distinctiveness is more than 99%
    That'll come from the old metalink guidance. It doesn't exist now. Oracle reviewed it and pulled it. You might want to think about a 1 billion row table (2 years of the OP's highest growth rate). Would an index on a randomly distributed varchar column on that table of a height of 5 be especially inefficient?
    I don't understand 'distinctiveness'
    Niall Litchfield
    http://www.orawin.info/

  • How do I find the font for a specific character in a textItem?

    I'm writing a script that builds a font list for an open document. While I could have lookup the fonts for the file as a whole, my goal is to iterate over specific layerSets to build a font list from. The issue I'm facing, is that referencing:
    app.fonts[text[n].textItem.font].name
    Only pulls the font name of the first character of the textItem. I need to get the names of all the fonts in the textItem, and while I can successfully loop through each of the letters, they do not have the character attributes associated with them.
    I tried this: app.fonts[text[n].textItem.contents.font].name
    As well as many iterations of a similar idea, and I cannot get it to pull the font name, as it's not an attribute of each character. I apologize if this is a remedial question, but I'm a bit of a novice with javascript in Adobe programs.
    For an example of what I'm trying to acheive, I was easily able to do this in illustrator, by using the following statement:
    fontName = text.characters[j].characterAttributes.textFont.name;
    When placed in a loop, this goes through each font in the text Layer.

    This should get a list of the fonts used in Type Layers in the selected Group.
    // get list of fonts used in the active group;
    // based on code by paul riggott;
    // 2014, use it at your own risk;
    #target "photoshop-70.032"
    if (app.documents.length > 0) {
    var theFonts = main ();
    alert ("the fonts used in the folder " + activeDocument.activeLayer.name + " are"+"\n"+theFonts.join("\n"))
    function main () {
    var theFonts = new Array;
    var someLayerStuff = getActiveLayerIIndex();
    if (someLayerStuff[1] != "layerSectionStart") {return []};
    var aNumber = 0;
    // get number of layers;
    var ref = new ActionReference();
    ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
    var applicationDesc = executeActionGet(ref);
    var theNumber = applicationDesc.getInteger(stringIDToTypeID("numberOfLayers"));
    // determine the start index;
    if (activeDocument.layers[activeDocument.layers.length - 1].isBackgroundLayer == true) {var theStart = someLayerStuff[0] - 2}
    else {var theStart = someLayerStuff[0] - 1};
    for (var p = theStart; p >= 0; p--) {
    try {
    var ref = new ActionReference();
    ref.putIndex( charIDToTypeID( "Lyr " ), p);
    var layerDesc = executeActionGet(ref);
    var layerSet = typeIDToStringID(layerDesc.getEnumerationValue(stringIDToTypeID("layerSection")));
    var isBackground = layerDesc.getBoolean(stringIDToTypeID("background"));
    var theName = layerDesc.getString(stringIDToTypeID('name'));
    // check if group closes;
    if (layerSet == "layerSectionStart") {aNumber++};
    if (layerSet == "layerSectionEnd" && aNumber == 0) {return theFonts};
    if (layerSet == "layerSectionEnd" && aNumber != 0) {aNumber--};
    // if not layer group collect values;
    if (layerSet != "layerSectionEnd" && layerSet != "layerSectionStart" && isBackground != true) {
    var hasText = layerDesc.hasKey(stringIDToTypeID("textKey"));
    if (hasText == true) {
    var textDesc = layerDesc.getObjectValue(stringIDToTypeID('textKey'));
    var paragraphStyle = textDesc.getList(stringIDToTypeID('paragraphStyleRange'));
    var kernRange = textDesc.getList(stringIDToTypeID('kerningRange'));
    var rangeList = textDesc.getList(stringIDToTypeID('textStyleRange'));
    for (var o = 0; o < rangeList.count; o++) {
    var styleDesc = rangeList.getObjectValue(o).getObjectValue(stringIDToTypeID('textStyle'));
    var aFont = styleDesc.getString(stringIDToTypeID('fontPostScriptName'));
    // add to array;
    var theCheck = true;
    for (var n = 0; n < theFonts.length; n++) {
    if (theFonts[n] == aFont) {theCheck = false}
    if (theCheck  == true) {theFonts.push(aFont)}
    catch (e) {};
    return theFonts
    ////// get some stuff from the active layer //////
    function getActiveLayerIIndex () {
    var ref = new ActionReference();
    ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
    var layerDesc = executeActionGet(ref);
    var theIndex = layerDesc.getInteger(stringIDToTypeID("itemIndex"));
    var theSection = typeIDToStringID(layerDesc.getEnumerationValue(stringIDToTypeID("layerSection")));
    var hasText = layerDesc.hasKey(stringIDToTypeID("textKey"));
    return [theIndex, theSection, hasText]

  • How do I get rid of the white background in text boxes in Dreamweaver?

    I use a lot of reversed text on my site, and not being able to see the text in the split view means I have to edit in the code view slows me down no end… I've tried changing the obvious view options, but can never seem to find the one that makes the boxes transparent. Is there an easy fix to this???anx if you can help
    Many thanx if you can help. (;

    Here's a screengrab of the problem.
    This page uses no text nav; instead uses z-index' similar to layers in photoshop, where image maps on overhangs from the pictures/pages underneath, to navigate to other pages.
    But when working on it in Dreamweaver, it's a nightmare, because of the white boxes, which often almost completely obscure the layered divs underneath.
    Is there no easy way 4 DW to just make these boxes transparent in the View. Switching off Style Rendering doesn't really help.
    But thanx all for your help so far.

  • Help with a carousel menu

    Hi guys.
    I have a download it a very good carousel menu,it works perfect but I been trying to insert a new effect in it, to make the objects of the menu a little bigger when they are in the front, and smallers when they are in the back, but all I can find its a property to change the size of the whole group.
    Please, its there any way to do this?
    PS: sorry for English.
    This is the code.
    import flash.filters.BlurFilter;
    import flash.filters.BitmapFilterQuality;
    import fl.transitions.easing.*;
    import fl.transitions.*;
    //CAROUSEL PARAMETERS
    var radiusX:Number = stage.stageWidth/3.5;
    var radiusY:Number = 50;
    var centerX:Number = stage.stageWidth/2.3;
    var centerY:Number = stage.stageHeight/1.5;
    var fade = 1; //modify carousel image alpha [0,1]
    var useFixedImageSize = 1;
    var activeMc;
    //change the speed
    var speed:Number = 0.01;
    var mouse_acc = 25000;
    var container:MovieClip = new MovieClip(); //thumbs container
    this.addChild(container);
    //large Image variables
    var imgM = new imgMcLarge();
    var largeImage = imgM;
    this.addChild(largeImage);
    var largeImageText = largeImage.bar;
    var loader = largeImage.preloadanim;
    var largeImageX = 2;
    var largeImageY = 2;
    largeImage.visible = false;
    largeImage.x = centerX-largeImage.width/2.2;
    largeImage.y = 0;
    //set xml data file
    var xmlData = "images.xml";
    var xmlObj: XMLDocument;
    var nodes = new Array();
    var mcArray:Array = new Array(); // store the Items to sort them according to their 'depth' - see sortBySize() function.
    init(); //init call -> load config XML and create objects
    function init() {
    xmlObj = new XMLDocument();
    xmlObj.ignoreWhite = true;
    var loader:URLLoader = new URLLoader();
    var request:URLRequest = new URLRequest(xmlData);
    loader.load(request);
    loader.addEventListener("complete", onComplete);
    loader.addEventListener("ioError", onIOError);            
    function onIOError(event:Event):void {
        trace("IOERROR (maybe XML file does not exit or have an incorrect name)");
    function onComplete(event:Event):void
        var loader:URLLoader = event.target as URLLoader;
        if (loader != null)
         xmlObj.parseXML(loader.data);
         xmlHandler();
        else
            trace("Loader is not a URLLoader!");
    function xmlHandler() {
    addObjects();
    startEngine();
    function startEngine () {
    container.addEventListener("enterFrame",startMovie);
    var numItems;
    var objects;
    var idx;
    function addObjects() { //add objects in the scene
    objects = xmlObj.firstChild.childNodes;
    numItems = objects.length;
    for(var i=0; i<numItems; i++) {
        if (useFixedImageSize==1) source1 = "item"; //image mc linkage id from the library
          else source1 = "item_01";   
    var sourceType1 = "library";
    var regName1 = "p"+i; //the registration name used in Flash
    var classDef = getDefinitionByName(source1);
    var menuItemMc = new classDef;
    menuItemMc.name = regName1;
    container.addChild(menuItemMc);
    var currMc = container.getChildByName(regName1);
    var currMc0 = container.getChildByName("p0");
    idx = container.getChildIndex(currMc0);
    //trace(currMc.name+"  "+idx);
    mcArray.push(currMc);
    currMc.buttonMode = true;
    currMc.useHandCursor = true;
    currMc.mouseChildren = false;
          currMc["info"]=objects[i];
        currMc._load.alpha = fade;
        currMc.addEventListener("mouseOver",mouseRollOver);
        //currMc.addEventListener("mouseOut",mouseRollOut);
        currMc.addEventListener("mouseDown",mousePress);
    currMc._angle = i*((Math.PI*2)/numItems);
    function mouseRollOver(e:MouseEvent){
        //e.target._load.alpha = 1;
        TransitionManager.start(e.target, {type:Photo, direction:Transition.IN, duration:0.5, easing:Strong.easeOut});
        e.target.addEventListener("motionFinish",finishAnim);
    function finishAnim(e:Event){
        e.target._load.alpha = fade;
    function mouseRollOut(e:MouseEvent){
        e.target._load.alpha = fade;
    function mousePress(e:MouseEvent) {
    loadBigImage(e.target);
    activeMc = e.target;
    var releaseOutsideTarget;
    var url5;
    function loadBigImage(menuItemMc) {
        stage.addEventListener(MouseEvent.MOUSE_UP, releaseHandler);
          releaseOutsideTarget = menuItemMc;   
        if (largeImage.twOut!=undefined) {
       var has = largeImage.twOut.hasEventListener("motionFinish");
       if (has) largeImage.twOut.removeEventListener("motionFinish",largeImage.finishHandler);
      var url = menuItemMc["info"].attributes.image;
      largeImage["info"]=menuItemMc["info"];
      var request1 = new URLRequest(url);
    var loader1 = new Loader();
      var mc1 = largeImage.getChildByName("imgBoxLarge");
      var numchild = mc1.numChildren;
         if (numchild) {
               var l1 = mc1.getChildAt(0);
               mc1.removeChild(l1);
               l1 = null;
      loader1.load(request1);  //start loading img/swf
    mc1.addChild(loader1);
    loader1.contentLoaderInfo.addEventListener("progress", largeImage.progress_loading);
    loader1.contentLoaderInfo.addEventListener("complete", largeImage.finished_loading);
      loader.visible = true;
      largeImageText.text_field.text = menuItemMc["info"].attributes.description;
        function releaseHandler(e:MouseEvent) {
             stage.removeEventListener(MouseEvent.MOUSE_UP, releaseHandler);
             releaseOutsideTarget = null;   
    function startMovie(e:Event) {
        //add objects in the scene
    for (var i = 0; i<numItems; i++) {
        var regName1 = "p"+i;
        var currMc = container.getChildByName(regName1);
        currMc.x = Math.cos(currMc._angle)*radiusX+centerX;
        currMc.y = Math.sin(currMc._angle)*radiusY+centerY;
        var s:Number = currMc.y/(centerY+radiusY);
        currMc.scaleX = s*1;
        currMc.scaleY = s*1;
        currMc._angle += speed;
        url2 = currMc["info"].attributes.url;
        //trace(url2);
        var dpth = Math.round(currMc.scaleX)+120;
        sortBySize();
    // set the display list index (depth) of the Items according to their
    // scaleX property so that the bigger the Item, the higher the index (depth)
    function sortBySize():void {
        // There isn't an Array.ASCENDING property so use DESCENDING and reverse()
        mcArray.sortOn("scaleX", Array.DESCENDING | Array.NUMERIC);
        mcArray.reverse();
        for(var i:uint = 0; i < mcArray.length; i++) {
           container.setChildIndex(mcArray[i], i+idx);
    stage.addEventListener("mouseMove", rotateCar);
    function rotateCar(e:MouseEvent)
    speed = (this.mouseX - centerX) / mouse_acc;

    that should change the size of each based on it's y property which should work if the objects in front are lower on your stage.  so, use:
    var scaleMax:Number = 2; // or whatever you want for the max scale of objects in front
    var scaleMin:Number = .5;  // or whatever you want  for the min scale for objects behind
    //begin don't change this ////
    paramsF(this,(centerY-radiusY)/(centerY+radiusY),scaleMin,1,scaleMax);
    function paramsF(mc:MovieClip,x1:Number,y1:Number,x2:Number,y2:Number):void{
    this.m = (y1-y2)/(x1-x2);
    this.b = y1=this.m*x1;
    function resizeF(s:Number):Number{
    return this.m*s+this.b;
    //end don't change////////////////////////////
    then instead of your currMc.scaleX code, use:
    currMc.scaleX =resizeF(s);
    currMc.scaleY=resizeF(s);

  • Set border for JComboBox

    i'm trying to change the border for a JComboBox...actually the default border for a JComboBox is null but it is the border for the JScrollPane used by the JComboBox that i want to change....i'm lost as to how to access the JScrollPane that the JComboBox uses so i can change it's border...any ideas?...thanx in advance...

    This might help you see the component you're looking for, but at YATArchivist said, it is a look and feel not a JCombobox componentimport  javax.swing.*;
    import  java.awt.*;
    import  java.util.Random;
    import  java.awt.event.*;
    public class ComboScroll {
      static Random rnd = new Random(); 
      public static void main (String[] args) {
        try {
          if (args.length > 0) {
            UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
        } catch (Exception ex) {
          ex.printStackTrace();
        final JComboBox combobox = new JComboBox(
          ("foo|bar|baz|" + UIManager.getCrossPlatformLookAndFeelClassName()).split("\\|"));
        combobox.setEditable(true);
        final JFrame frame = new JFrame("ComboScroll");
        frame.getContentPane().add(combobox);
        frame.setVisible(true);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Timer timer = new Timer(800, new ActionListener () {
          public void actionPerformed (ActionEvent e) {
            dumpTree(frame, 0);
            Window[] windows = frame.getOwnedWindows();
            for (int index = 0; index < windows.length; index++) {
              dumpTree(windows[index], 0);
            System.out.println();
        timer.setRepeats(true);
        timer.start();
      static void dumpTree (Component component, int depth) {
        String className = component.getClass().getName();
        System.out.println(indent(depth) + component.getName() + ":" + className);
        if (component instanceof Container) {
          Container container = (Container)component;
          for (int index = 0; index < container.getComponentCount(); index++) {
            dumpTree(container.getComponent(index), depth + 1);
          if (component instanceof JComponent) {
            try {
              ((JComponent)component).setBorder(
                BorderFactory.createTitledBorder(
                  BorderFactory.createMatteBorder(4, 4, 4, 4, new Color(
                    rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256))),
                  className.substring(className.lastIndexOf('.') + 1)));
            } catch (Exception ex) {
        if (depth == 0) {
          System.out.println();
      static String indent (int depth) {
        return "                                         ".substring(0, depth * 2);
    }Pete

  • Problems with large Photoshop files CC 2014

    Hi,
    Having a strange issue with the file size of some psd's.
    I have two basicly identical images. They are both the same size (same ppi och same mesurments in cm). Both of them are singel layer and there are no paths or other hidden stuff. Both are in sRGB as well. The issue here is that the file on the left is about 12 MB and the one on the right is almost twice that and I can't for the life of me figure out why? As far as I'm concerned the image on left looks a bit more "advanced" and should be the bigger one.
    This isn't just this image but most of the images i've been working on for the last couple of weeks. Chose this one becuse it was easy to compare to an older image around the same size.
    Also recived some images from Samsung a couple a days ago wich where the same size as these ones but where 135 MB!!! After flattening the image to one layer it went down to about 25-27 MB but that still feels a alot to me.
    Has there been any changes to the way Photoshop handles the file size in the latest verison (CC 2014)?
    And befor anyone asks, yes they are saved for maximised compability.
    Any idea's? Sorry for the bad english by the way

    No, there are no changes to the handling of large files, or files in general.
    But mistakes in bit depth, cropping, layers, etc. could explain a file size difference for files that look sort of the same.

  • Script works Great, Pro-Tips appreciated.

    This script is used to make a few changes that SOME of our die suppliers require. It works great. If you have a little time to look it over and give me some advice on best practices, consiseness etc. it would be greatly appreciated.
    Note: The files this script is aimed at are fairly civilized, and don't vary much so I didn't have to buld in room for varience. For example, the die lines will ALWAYS be a spot color, so I didn't need to include anything for RGB or CMYK.
    // script.name = prepDieFile.js;
    // script.description = removes unnecessary layers, vectors, and text. Leaves cross-mark line unpainted. Colors all remaining text and strokes black;
    // script.requirements = an opened document;
    // script.parent = elDudereno // 10/10/13;
    // script.elegant = false;
    #target Illustrator
    var idoc = app.activeDocument;
    var pi = idoc.pathItems;
    var tf = idoc.textFrames;
    var deletedLayers = 0;
    var deletedPaths = 0;
    var spotStroke = 0;
    var deletedText = 0;
    var blackedText = 0;
    var layerCount = idoc.layers.length;
    //loop through all layers deleting hidden layers. Loop from the back, to preserve index of remaining layers when we remove one.
    for (var i = layerCount - 1; i >= 0; i--) {
              var thisLayer = idoc.layers[i];
              if (thisLayer.visible == false || thisLayer.locked == true) {
                        thisLayer.visible = true;
                        thisLayer.locked = false;
                        thisLayer.remove();
                        deletedLayers++;
    unlockPaths();
    //locate largest path item (bounding box) and lock it.
    var theBiggest = pi[0];
    for (i=1; i<pi.length; i++) {
              if (Math.abs(pi[i].area) > Math.abs(theBiggest.area)) {
                        theBiggest = pi[i];
    theBiggest.remove();
    deletedLayers++;
    //locate second largest path (cross-mark size) remove stroke and lock
    var secondBiggest = pi[0];
    for (j=1; j<pi.length; j++) {
              if (Math.abs(pi[j].area) > Math.abs(secondBiggest.area)) {
                        secondBiggest = pi[j];
    secondBiggest.strokeColor = NoColor;
    secondBiggest.fillColor = NoColor;
    secondBiggest.locked = true;
    // loop through path items delete if hidden, registration, or un-stroked. Change all non-registration spot colors to 100% GrayColor.
    for (var j=pi.length -1; j >= 0; j--) {
              var ipath = pi[j];
              if (ipath.hidden==true) {
                        ipath.remove();
                        deletedPaths++;
              if (ipath.locked==false) {
                        var strokeColor = ipath.strokeColor;
                        if (strokeColor.typename == "NoColor"){
                                  ipath.remove();
                                  deletedPaths++;
                        else if (strokeColor.typename == "SpotColor"){
                                  if (strokeColor.spot.name == "[Registration]"){
                                            ipath.remove();
                                            deletedPaths++;
                                  } else {
                                            ipath.strokeColor = GrayColor;
                                            ipath.strokeColor.gray = 100.0;
                                            spotStroke++;
    unlockPaths();
    // delete text frames with first letter set to registration. Turn all other text to black.
    for (t=tf.length -1; t>=0; t--) {
              var iTxtFrm = tf[t];
              var firstLtr = iTxtFrm.characters[0];
              if (firstLtr.characterAttributes.fillColor.spot.name == "[Registration]"){
                        iTxtFrm.remove();
                        deletedText++;
              else {
                        var chars = iTxtFrm.characters;
                        for (var c=0; c<chars.length; c++) {
                                  var ltr = chars[c];
                                  ltr.characterAttributes.fillColor = GrayColor;
                                  ltr.characterAttributes.fillColor.gray = 100.0;
                                  blackedText++;
    redraw();
    alert(deletedLayers + " hidden or locked layer(s), " + deletedPaths + " path(s) & " + deletedText + " text frames, were deleted.  " + blackedText + " letters, & " + spotStroke + " stroke(s) were converted to 100% K.");
    //unlock all path items
    function unlockPaths(){
              for (var k=0; k<pi.length; k++){
                        var lpath = pi[k];
                        if (lpath.locked == true){
                                  lpath.locked = false;
    Thanks for taking a look.
    http://www.filedropper.com/0388701die <-sample file.

    I recently updated this to delete all but one artboard and make the remaining artboard the same size as the object with the largest area.
    // script.name = prepDieFile.js;
    // script.description = removes unnecessary layers, vectors, and text. Leaves cross-mark line unpainted. Colors all remaining text and strokes black;
    // script.requirements = an opened document;
    // script.parent = elDudereno // 10/10/13;
    // script.elegant = false;
    #target Illustrator
    var idoc = app.activeDocument;
    var pi = idoc.pathItems;
    var tf = idoc.textFrames;
    var deletedLayers = 0;
    var deletedPaths = 0;
    var spotStroke = 0;
    var deletedText = 0;
    var blackedText = 0;
    var deletedBoards = 0;
    var boardCount = idoc.artboards.length;
    //loop through all artboards deleting all but the first.
    for (var i = boardCount - 1; i >= 1; i--) {
      var thisBoard = idoc.artboards[i];
      thisBoard.remove();
      deletedBoards++;
    var layerCount = idoc.layers.length;
    //loop through all layers deleting hidden layers. Loop from the back, to preserve index of remaining layers when we remove one.
    for (var i = layerCount - 1; i >= 0; i--) {
      var thisLayer = idoc.layers[i];
      if (thisLayer.visible == false || thisLayer.locked == true) {
      thisLayer.visible = true;
      thisLayer.locked = false;
      thisLayer.remove();
      deletedLayers++;
    unlockPaths();
    //locate largest path item (bounding box) set artboard to that size and remove path.
    var theBiggest = pi[0];
    for (i=1; i<pi.length; i++) {
      if (Math.abs(pi[i].area) > Math.abs(theBiggest.area)) {
      theBiggest = pi[i];
    idoc.artboards[0].artboardRect=theBiggest.geometricBounds;
    theBiggest.remove();
    deletedLayers++;
    //locate second largest path (cross-mark size) remove stroke and lock
    var secondBiggest = pi[0];
    for (j=1; j<pi.length; j++) {
      if (Math.abs(pi[j].area) > Math.abs(secondBiggest.area)) {
      secondBiggest = pi[j];
    secondBiggest.strokeColor = NoColor;
    secondBiggest.fillColor = NoColor;
    secondBiggest.locked = true;
    // loop through path items delete if hidden, registration, or un-stroked. Change all non-registration spot colors to 100% GrayColor.
    for (var j=pi.length -1; j >= 0; j--) {
      var ipath = pi[j];
      if (ipath.hidden==true) {
      ipath.remove();
      deletedPaths++;
      if (ipath.locked==false) {
      var strokeColor = ipath.strokeColor;
      if (strokeColor.typename == "NoColor"){
      ipath.remove();
      deletedPaths++;
      else if (strokeColor.typename == "SpotColor"){
      if (strokeColor.spot.name == "[Registration]"){
      ipath.remove();
      deletedPaths++;
      } else {
      ipath.strokeColor = GrayColor;
      ipath.strokeColor.gray = 100.0;
      spotStroke++;
    unlockPaths();
    // delete text frames with first letter set to registration. Turn all other text to black.
    for (t=tf.length -1; t>=0; t--) {
      var iTxtFrm = tf[t];
      var firstLtr = iTxtFrm.characters[0];
      if (firstLtr.characterAttributes.fillColor.spot.name == "[Registration]"){
      iTxtFrm.remove();
      deletedText++;
      else {
      var chars = iTxtFrm.characters;
      for (var c=0; c<chars.length; c++) {
      var ltr = chars[c];
      ltr.characterAttributes.fillColor = GrayColor;
      ltr.characterAttributes.fillColor.gray = 100.0;
      blackedText++;
    redraw();
    alert(deletedBoards + " art board(s), " + deletedLayers + " hidden or locked layer(s), " + deletedPaths + " path(s) & " + deletedText + " text frames, were deleted.  " + blackedText + " letters, & " + spotStroke + " stroke(s) were converted to 100% K.");
    //unlock all path items
    function unlockPaths(){
      for (var k=0; k<pi.length; k++){
      var lpath = pi[k];
      if (lpath.locked == true){
      lpath.locked = false;
    Credit to @Tom_Friedman for post 13 in this thread Re: Resize Artboard

  • Security Dialog Box appears in Javascripts

    hi all.
    I ve some problem with my javascript which is used to present menus at the homepage. I have a dropdown menu also, wherein, whenever I rollover t mouse on dropdown menus, a security dialog box appears(this page works on https), and it doesnot appear until u refresh the page again.
    I have 2 menu scripts. In menu1.js, I call a fn which is in menu_main.js
    The call in menu1.js, goes like this
    startSubmenu("menu_pre_b7","menu_pre_menu",83);submenuItem("Help",loc+"pre_help.htm","_self","menu_pre_plain");submenuItem("Search",loc+"GetPage1Action.do?command=getPage1","_self","menu_pre_plain");submenuItem("DJVU Plugin",loc+"pre_lizardtech_djvu.htm","_self","menu_pre_plain");endSubmenu("menu_pre_b7"); and the menu_main.js has the function for startSubMenu as
    function startSubmenu(name,style,sw){var depth=name.split("_").length+1000;if(NS4)return;if(sw>0)menuw=sw;d.write("<div id=\""+name+"\" style=\"z-index:999;border-color:#000000;border-style:solid;border-width:"+bd+"px 0px "+bd+"px 0px;background-color:#ffffff;position:absolute;left:0px;top:0px;visibility:hidden;z-index:"+depth+";width:"+(menuw+(NS7?bd*2:0))+"px\">");}I hope the problem is with the startSubMenu function. Can someone help me on this?

    Unfortunately this forum is for the Java programming language, not for the ECMAScript compliant Javascript.
    Sincerely,
    Jussi

  • How does " bringToFront()"  work?

    I have a movie clip in a game I am making, that replaces the
    mouse. I need it to be infront of everything else on the stage, and
    some things are attached from the library (so I can't controll
    their depth with layers anymore). I thought I had worked it out
    when I found the bringToFront(); function, but I don't think I am
    using it properly, because it doesn't turn blue like I thought it
    should, and it doesn't effect the depth of the movieclip. This is
    what i wrote:
    var d = my_mc.bringToFront();
    I would be greatful for any help. Thanks.
    P

    You need to be carfeul using getNextHighestDepth() as it can
    result in movieclips that don't allow you to remove them (if the
    value from that function is ridiculously high - which it often is).
    I had this problem and was scratching my head for ages trying to
    work out what was going on!
    You also need to remember that each clip has to have it's own
    depth (that may explain why your cursor disappeared after a short
    while if you were still creating movie clips and they hit the same
    depth?)
    I tend to keep my depths in chunks ... so I reserve them in
    groups ... for example, if I was writing a game I might put the
    aliens on depths from 1000 to 2000, the player ship on layer 3000,
    bullets on 4000 to 5000 .... etc. That way I know what should be
    sitting above what and I don't have to keep swapping depths all the
    time. Depending on your application this may or may not be
    practical.

  • Fill Array with all possible combinations of 0/1

    Hi,
    i'm looking for a fast way to fill an array, respectively an int[8], with all possible combinations of 0 and 1 (or -1 and 1, shouldn't make a difference).
    I kind of know how to do it using multiple loops but I assume there is a more elegant or at leaster "better" practice.
    Thanks,
    nikolaus
            static int cnt = 0;
         public static void main(String[] args) {
              int[] element = new int[]{1,1,1,1,1,1,1,1};
              Integer[] x = new Integer[2];
              x[0] = 1;
              x[1] = -1;
              for(int i7:x){
                   element[7] = i7;
                   for(int i6:x){
                        element[6] = i6;
                        for(int i5:x){
                             element[5] = i5;
                             for(int i4:x){
                                  element[4] = i4;
                                  for(int i3:x){
                                       element[3] = i3;
                                       for(int i2:x){
                                            element[2] = i2;
                                            for(int i1:x){
                                                 element[1] = i1;
                                                 for(int i0:x){
                                                      element[0] = i0;
                                                      cnt++;
              }Edited by: NikolausO on Oct 30, 2008 4:21 AM
    Edited by: NikolausO on Oct 30, 2008 4:22 AM

    pm_kirkham wrote:
    No I replied to message number 5. as the ' (In reply to #5 )' above my post indicates, which was in reply to (a reply) to Sabre150's post which wasn't using enhanced loops, nor has any obvious place where you could use that approach to fill the array.
    Though you could pass in an array of the values to fill the array with, and loop over those, instead of using 0 or 1, at which point Sabre's approach becomes the same as your OP, but without the manual unrolling:
    import java.util.Arrays;
    public class NaryCombinations {
    public interface CombinationHandler {
    void apply (int[] combination) ;
    public static void main(String[] args) {
    calculateCombinations(new int[]{-1, 0, 1}, 4, new CombinationHandler () {
    public void apply (int[] combination) {
    System.out.println(Arrays.toString(combination));
    public static void calculateCombinations (int[] values, int depth, CombinationHandler handler) {
    recursivelyCalculateCombinations(values, 0, depth, handler, new int[depth]);
    private static void recursivelyCalculateCombinations (int[] values, int index, int depth,
    CombinationHandler handler, int[] combination) {
    if (index == depth) {
    handler.apply(combination);
    } else {
    for (int value : values) {
    combination[index] = value;
    recursivelyCalculateCombinations(values, index + 1, depth, handler, combination);
    Which looks to use the same basic approach to the generalization I created shortly after posting the original.
    public class Scratch1
         * A 'callback' to be invoked with every combination
         * of the result.
        public interface Callback
             * Invoked for each combination.
             * <br>
             * Each call is passed an new instance of the array.
             * @param array the array containing a combination.
            void processArray(int[] array);
        public Scratch1(final int[] array, final Callback callback, final int... values)
            if (callback == null)
                throw new IllegalArgumentException("The 'callback' cannot be 'null'");
            if (array.length < 1)
                throw new IllegalArgumentException("The array length must be >= 1");
            if ((values == null) || (values.length < 1))
                throw new IllegalArgumentException("The 'values' must have be at least of length 2");
            callback_ = callback;
            values_ = values.clone();
            array_ = array;
        public Scratch1(final int order, final Callback callback, final int... values)
            this(new int[order], callback, values);
         * Generates every possible value and invokes the callback for each one.
        public void process()
            process(0);
         * Internal method with no logical external use.
        private void process(int n)
            if (n == array_.length)
                callback_.processArray(array_.clone());
            else
                for (int v : values_)
                    array_[n] = v;
                    process(n + 1);
        private final Callback callback_;
        private final int[] values_;
        private final int[] array_;
        public static void main(String[] args) throws Exception
            final Callback callback = new Callback()
                public void processArray(int[] array)
                    System.out.println(java.util.Arrays.toString(array));
            new Scratch1(6, callback, 2, 1, 0).process();

  • How do I get the Photoshop layer tags in JavaScript?

    I asked this question at graphic design stack exchange but they pointed me here:
    http://graphicdesign.stackexchange.com/questions/35374/how-do-i-get-the-photoshop-layer-ta gs-in-javascript?noredirect=1#comment48962_35374
    I want to do actions based on the tagged layer color (these thing 1) in Photoshop. I can't find a property inside the JavaScript documentation or the ExtendScript Toolkit that might contain the value.
    I'd prefer not to abuse the name for that, the layer tags look like a very clean solution to my problem. If only I could fetch them.
    Any Ideas?
    Kind Regards,
    Mii

    Hi, these functions will select all your layers with the specified color:
    use the command: selectAllByColor("red");
    function getIDXwithsameColor(TheColor){// search and return a list of indexes for the layers with the specified color
        var ref = new ActionReference();
        var toRet = [];
        try{activeDocument.backgroundLayer;var a=0 }catch(e){ var a = 1; };
        while(true){
          ref = new ActionReference();
          ref.putIndex( charIDToTypeID( 'Lyr ' ), a );
          try{var desc = executeActionGet(ref);}catch(err){break;}
            var cl = desc.getEnumerationValue(charIDToTypeID("Clr "));
            cl = typeIDToStringID(cl);
            var ls = desc.getEnumerationValue(stringIDToTypeID("layerSection"));
            ls = typeIDToStringID(ls);
            if(ls != 'layerSectionEnd'){
              if(cl == TheColor){
                toRet.push(a);
          a++;
        return toRet;
    function multiSelectByIDX(idx) {// selection function
      if( idx.constructor != Array ) idx = [ idx ];
        var layers = new Array();
        var desc = new ActionDescriptor();
        var ref = new ActionReference();
        for (var i = 0; i < idx.length; i++) {
              layers[i] = charIDToTypeID( "Lyr " );
              ref.putIndex(layers[i], idx[i]);
        desc.putReference( charIDToTypeID( "null" ), ref );
        executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );
    function selectAllByColor(TheColor){// main function
      theSameClIDX = getIDXwithsameColor(TheColor);
      multiSelectByIDX(theSameClIDX);
    //...example::
    // selectAllByColor("none");
    //selectAllByColor("red");
    // selectAllByColor("orange");
    // selectAllByColor("yellowColor");
    // selectAllByColor("grain");
    // selectAllByColor("blue");
    // selectAllByColor("violet");
    // selectAllByColor("gray");

  • CS4 Upgrade Questions

    Hello,
    My Dad currently has a version of CS3 witch he hardly uses. I'm wanting too upgrade that too CS4 but I have a few questions.
    Firstly when I get the CS4 upgrade disk can I just put it straight into my Mac and install it, all Photoshop will ask of me is the serial number too CS3 too check I am eligible too upgrade correct? That's all the Adobe website is saying I will need. (The current CS3 we have is also a Mac version)
    Also can I go on to then register CS4 too myself? Have it as my product with my contact details and email address etc? Or will I not get asked that during installation? Will it automatically register it too the owner of the CS3 serial(my dad?).
    And would I be correct in thinking that CS3 serial could not be used again in the future too upgrade from but could still be installed on 2 machine's?
    Many thanks for any help in advance.
    Ben

    You are entitled to one upgrade.
    When I installed CS3, I was asked for my previous serial number, which is on the box or in the documentation of the older product.
    Were I you, I'm not sure I'd upgrade to CS4 though. There are lots of reports of it having major issues with both Leopard and Snow Leopard. I am sticking with CS3 for now.
    CS4 lets you paint directly on 3D models, wrap 2D images around 3D shapes, convert gradient maps to 3D objects, add depth to layers and text, get print-quality output with the new ray-tracing rendering engine, and enjoy exporting to supported common 3D formats; the new Adjustment and Mask Panels. It's a 64-bit application in Windows Vista and not OS X.
    Adobe's Facebook page suggests that CS5 will come out this year and they're working to improve the application. I'd like to see a 64-bit Mac application that doesn't crash like CS4 is said to do on Snow Leopard.

Maybe you are looking for

  • List view in Calendar App

    Morning. Is there a way to enable Calendar App to show the end time of events in list view? Kind regards, Friedrich

  • Best way to set up email/contacts/calendar on iPhone and 2 PCs?

    Here's what I want to accomplish on the iPhone, at as little (no) cost as possible: 1. Personal comcast.net email account. I currently have this configured with "Delete from server" set to "When removed from inbox". At least this way if I read and de

  • Very hot Mac!

    Hi, Is there any reason why a macbook would get hot if it's been turned off? I turned off my macbook earlier this evening,and put it in it's slip case,and then into my rucksack.I Went out for a while and did some shopping (rasberries!) came home and

  • Do i need to re-download purchased movies every time i want to watch them?

    i recently bought the apple tv, and purchased several movies. every time i want to replay a movie that ive already watched before, apple tv directs me to the download page and keeps me waiting until the movie re-downloads. is this logical, im sure so

  • OracleAS Adapter for SAP

    my plan is to extract data from the current Oracle sales and distribution Legacy system into txt file with IDOC format, my question is (since I do not have the SAP experience), how this file will get uploaded into the SAP system through the Oracle AS