Create symbol ready

on stage you got composition ready to add code too
but what if you want to push code when a dynamic symbol got created?
i tried using timeline update in symbols, but that would bug my script and run again if the symbol gets deleted again.
what is the best to use for this?
- Rob

Hi,
Could you post a sample file?

Similar Messages

  • Illustrator script to create symbols from images in folder

    Time to give back to the community...
    Here is a script I recently devised to bulk create symbols from images in a folder. Tested with Illustrator CC 2014.
    // Import Folder's Files as Symbols - Illustrator CC script
    // Description: Creates symbols from images in the designated folder into current document
    // Author     : Oscar Rines (oscarrines (at) gmail.com)
    // Version    : 1.0.0 on 2014-09-21
    // Reused code from "Import Folder's Files as Layers - Illustrator CS3 script"
    // by Nathaniel V. KELSO ([email protected])
    #target illustrator
    function getFolder() {
      return Folder.selectDialog('Please select the folder to be imported:', Folder('~'));
    function symbolExists(seekInDoc, seekSymbol) {
        for (var j=0; j < seekInDoc.symbols.length; j++) {
            if (seekInDoc.symbols[j].name == seekSymbol) {
                return true;
        return false;
    function importFolderContents(selectedFolder) {
        var activeDoc = app.activeDocument;     //Active object reference
      // if a folder was selected continue with action, otherwise quit
      if (selectedFolder) {
            var newsymbol;              //Symbol object reference
            var placedart;              //PlacedItem object reference
            var fname;                  //File name
            var sname;                  //Symbol name
            var symbolcount = 0;        //Number of symbols added
            var templayer = activeDoc.layers.add(); //Create a new temporary layer
            templayer.name = "Temporary layer"
            var imageList = selectedFolder.getFiles(); //retrieve files in the folder
            // Create a palette-type window (a modeless or floating dialog),
            var win = new Window("palette", "SnpCreateProgressBar", {x:100, y:100, width:750, height:310});
            win.pnl = win.add("panel", [10, 10, 740, 255], "Progress"); //add a panel to contain the components
            win.pnl.currentTaskLabel = win.pnl.add("statictext", [10, 18, 620, 33], "Examining: -"); //label indicating current file being examined
            win.pnl.progBarLabel = win.pnl.add("statictext", [620, 18, 720, 33], "0/0"); //progress bar label
            win.pnl.progBarLabel.justify = 'right';
            win.pnl.progBar = win.pnl.add("progressbar", [10, 35, 720, 60], 0, imageList.length-1); //progress bar
            win.pnl.symbolCount = win.pnl.add("statictext", [10, 70, 710, 85], "Symbols added: 0"); //label indicating number of symbols created
            win.pnl.symbolLabel = win.pnl.add("statictext", [10, 85, 710, 100], "Last added symbol: -"); //label indicating name of the symbol created
            win.pnl.errorListLabel = win.pnl.add("statictext", [10, 110, 720, 125], "Error log:"); //progress bar label
            win.pnl.errorList = win.pnl.add ("edittext", [10, 125, 720, 225], "", {multiline: true, scrolling: true}); //errorlist
            //win.pnl.errorList.graphics.font = ScriptUI.newFont ("Arial", "REGULAR", 7);
            //win.pnl.errorList.graphics.foregroundColor = win.pnl.errorList.graphics.newPen(ScriptUIGraphics.PenType.SOLID_COLOR, [1, 0, 0, 1], 1);
            win.doneButton = win.add("button", [640, 265, 740, 295], "OK"); //button to dispose the panel
            win.doneButton.onClick = function () //define behavior for the "Done" button
                win.close();
            win.center();
            win.show();
            //Iterate images
            for (var i = 0; i < imageList.length; i++) {
                win.pnl.currentTaskLabel.text = 'Examining: ' + imageList[i].name; //update current file indicator
                win.pnl.progBarLabel.text = i+1 + '/' + imageList.length; //update file count
                win.pnl.progBar.value = i+1; //update progress bar
                if (imageList[i] instanceof File) {         
                    fname = imageList[i].name.toLowerCase(); //convert file name to lowercase to check for supported formats
                    if( (fname.indexOf('.eps') == -1) &&
                        (fname.indexOf('.png') == -1)) {
                        win.pnl.errorList.text += 'Skipping ' + imageList[i].name + '. Not a supported type.\r'; //log error
                        continue; // skip unsupported formats
                    else {
                        sname = imageList[i].name.substring(0, imageList[i].name.lastIndexOf(".") ); //discard file extension
                        // Check for duplicate symbol name;
                        if (symbolExists(activeDoc, sname)) {
                            win.pnl.errorList.text += 'Skipping ' + imageList[i].name + '. Duplicate symbol for name: ' + sname + '\r'; //log error
                        else {
                            placedart = activeDoc.placedItems.add(); //get a reference to a new placedItem object
                            placedart.file = imageList[i]; //link the object to the image on disk
                            placedart.name =  sname; //give the placed item a name
                            placedart.embed();   //make this a RasterItem
                            placedart = activeDoc.rasterItems.getByName(sname); //get a reference to the newly created raster item
                            newsymbol = activeDoc.symbols.add(placedart); //add the raster item to the symbols                 
                            newsymbol.name = sname; //name the symbol
                            symbolcount++; //update the count of symbols created
                            placedart.remove(); //remove the raster item from the canvas
                            win.pnl.symbolCount.text = 'Symbols added: ' + symbolcount; //update created number of symbols indicator
                            win.pnl.symbolLabel.text = 'Last added symbol: ' + sname; //update created symbol indicator
                else {
                    win.pnl.errorList.text += 'Skipping ' + imageList[i].name + '. Not a regular file.\r'; //log error
                win.update(); //required so pop-up window content updates are shown
            win.pnl.currentTaskLabel.text = ''; //clear current file indicator
            // Final verdict
            if (symbolcount >0) {
                win.pnl.symbolLabel.text = 'Symbol library changed. Do not forget to save your work';
            else {
                win.pnl.symbolLabel.text = 'No new symbols added to the library';
            win.update(); //update window contents
            templayer.remove(); //remove the temporary layer
        else {
            alert("Action cancelled by user");
    if ( app.documents.length > 0 ) {
        importFolderContents( getFolder() );
    else{
        Window.alert("You must open at least one document.");

    Thank you, nice job & I am looking forward to trying it out!

  • Is there any way to create "symbols" in InD like those in flash or Ai?

    Hi! Does someone know how can I create symbols in ID, for exemple, in Flash or Ai  you can create a simple "symbol" and save it into the "Library" in Flash or "Symbols" in Ai,  so you can use it many times, and if you change the main symbol, all the instances that you used in your artwork change automatically. Maybe one way is to make a symbol in ilustrator, and import it from Id, and if I change the origingal file, all the links change, but, can I do this directly in InDesing?
    Thanks

    They lack the edit and update all instances feature, though. Better to create the item in whatever application is appropriate and place it. Update the original, and you'll be asked if you want to update the links.

  • Get the ID of a dynamically created symbol from library, INSIDE another symbol.

    Hi everyone,
    I'm trying to get the id from a dynamic created symbol from library.
    When dynamically creating the symbol directly on the stage (or composition level), there's no problem.
    But I just can't get it to work when creating the symbol inside another symbol. 
    Below some examples using both "getChildSymbols()" and "aSymbolInstances" 
    // USING "getChildSymbols()" ///////////////////////////////////////////////////////////////////////// 
    // ON THE STAGE 
    var m_item = sym.createChildSymbol("m_item","Stage");
    var symbolChildren = sym.getChildSymbols(); 
    console.log(symbolChildren[0].getSymbolElement().attr('id')); // ok eid_1391853893203
    // INSIDE ANOTHER SYMBOL
    var m_item = sym.createChildSymbol("m_item", sym.getSymbol("holder").getSymbolElement()); 
    var symbolChildren = sym.getSymbol("holder").getChildSymbols(); // Am i using this wrong maybe?
    console.log(symbolChildren.length) // returns 0 so can't get no ID either
    // USING "aSymbolInstances"" ////////////////////////////////////////////////////////////////////////// 
    // ON THE STAGE
    var m_item = sym.createChildSymbol("m_item","Stage"); 
    console.log(sym.aSymbolInstances[0]); // ok (i guess) x.fn.x.init[1] 0: div#eid_1391854141436
    // INSIDE ANOTHER SYMBOL
    var m_item = sym.createChildSymbol("m_item", sym.getSymbol("holder").getSymbolElement());
    console.log(sym.getSymbol("holder").aSymbolInstances[0]); // Javascript error in event handler! Event Type = element 
    In this post http://forums.adobe.com/message/5691824 is written: "mySym.aSymbolInstances will give you an array with all "names" when you create symbols"
    Could it be this only works on the stage/ composition level only and not inside a symbol? 
    The following methods to achieve the same are indeed possible, but i simply DON'T want to use them in this case:
    1) Storing a reference of the created symbol in an array and call it later by index.
    2) Giving the items an ID manually on creation and use document.getElementById() afterwards.
    I can't believe this isn't possible. I am probably missing something here.
    Forgive me I am a newbie using Adobe Edge!
    I really hope someone can help me out here.
    Anyway, thnx in advance people!
    Kind Regards,
    Lester.

    Hi,
    Thanks for the quick response!
    True this is also a possibility. But this method is almost the same of "Giving the items an ID manually on creation and use document.getElementById() afterwards".
    In this way (correct me if i'm wrong) you have to give it an unique ID yourself. In a (very) big project this isn't the most practical way.
    Although I know it is possible.
    Now when Edge creates a symbol dynamically on the Stage (or composition level) or inside another symbol it always gives the symbol an ID like "eid_1391853893203".
    I want to reuse this (unique) ID given by Edge after creation.
    If created on the stage directly you can get this ID very easy. Like this;
    var m_item = sym.createChildSymbol("m_item","Stage");
    var symbolChildren = sym.getChildSymbols(); 
    console.log(symbolChildren[0].getSymbolElement().attr('id')); // ok eid_1391853893203
    I want to do exactly the same when created INSIDE another symbol.
    var m_item = sym.createChildSymbol("m_item", sym.getSymbol("holder").getSymbolElement());
    Now how can I accomplish this? How can I get the Id of a dynamically created symbol INSIDE another symbol instead of created directly on the stage?
    This is what i'm after.
    Thnx in advance!

  • How to get a dynamically created symbol to delete itself on click?

    Here's the setup...
    I want to have a dynamically created symbol appear upon click of a hotspot. In this case, you click on a pulsating hotspot and a popup box appears.
    Here's the code I'm using for that.
    //Create an instance element of a symbol as a child of the given parent element
    var mySymbolObject = sym.createChildSymbol("gardern_toxins_popup","stage");
    So we have the symbol "garden_toxins_popup" from my library placed dynamically on the page. I would like to assign an action to the pop-up itself that allows you to remove the symbol from the stage upon click.
    I feel silly for not being able to figure this out. I tried iterations of this bit of code...
    //Get the stage from the composition level, get the symbol
    sym.getComposition().getStage().getSymbol("garden_toxins_popup").delete();
    ...but it doesn't work.
    So I tried thinking like I was back in Flash and tried the following...
    this.parent.removeChild(this);
    But no joy on that as well. Is there something I haven't addressed in this logic or am I going about it in the wrong way? Thanks!

    Hi, chirpieguy-
    You'll want to use the deleteSymbol() API.
    http://www.adobe.com/devnet-docs/edgeanimate/api/current/index.html
    BTW, you should use the capitalized "Stage" to add it to the Stage - the lower case stage has a special meaning with Animate and might not give you what you want..
    sym.createChildSymbol("gardentoxins", "Stage");
    In the symbol itself, create a click event on a container div, then:
    sym.deleteSymbol();
    That being said, you don't need to dynamically create and delete an object.  What you can do is to use hide() and show() on an element and use the coordinates of your click to change the CSS value of top/left of this object so that you don't have to do the object management I highlighted above.
    Hope that points you in the right direction.
    -Elaine

  • Create Symbol=Lose Events

    IE-Grouping elements into a symbol causes loss of events.
    Not sure if this is a bug but has anyone else noticed this?
    The workaround I've found is to to group the elements into a div, but then obviously...
    You can try yourself with the lynda tut / chapter 10 /Creating responsive layouts.
    http://www.lynda.com/Edge-Animate-tutorials/Edge-Animate-Essential-Training/108880-2.html
    I noticed this happening to me when Edge 1st introduced responsive layout, but I thought it was something I was doing wrong...
    In the example above the event is being lost on the element not grouped into a symbol.
    Message was edited by: GVD321

    Joe Bowden wrote:
    When you created symbols out of the elements (specifically, putting the Text element in a symbol), the code and events you had previously on the apple image are no longer going to work because that Text element is no longer at the same level as the apple - it's now inside a symbol. In other words, sym.$("Text").html("your text here") can't work because there is no longer a "Text" element there at the Stage level. So the bug, as it is, was in the code used.
    When you want to address an element within a symbol, use the getSymbol method to address the symbol, and then address the element within it. I believe your symbol wasn named "chalkboard"? So in that case, your code should be something like this:
    sym.getSymbol("chalkboard").$("Text").html("your text here");
    The EA Javascript API is your friend:
    http://www.adobe.com/devnet-docs/edgeanimate/api/current/index.html
    hth,
    Joe
    That's what I suspected. A 'targeting level' issue.
    I wasn't sure if there was some magic in the js that compesated for not targeting the Text within the symbol.
    Same rule applies. Got it.
    Obviously I'm not the greatest with code but I'm trying.
    The EA Api makes me nauseous.
    But I'm trying:-)
    Edit
    Altho someone might wanna notify the presenter in that Lynda tut because that fact is not mentioned.
    Message was edited by: GVD321

  • Address dynamically created symbol

    Hi - wondering how I can get the name of a dynamically created symbol (using CreateChildSymbol) so i can hide move and otherwise affect the symbols i have created.
    any ideas?
    thanks!

    This recent thread might help you out:
    http://forums.adobe.com/message/5691752#5691752
    Thanks,
    -Elaine

  • Create symbol from "scratch"

    Hello all!
    I've been busy and haven't checked in here for awhile - I guess for me that's good :-)
    I've got a question that I know I'm not the only one and was wondering what others do...
    I have a stage with everything on it I want, including 6 buttons.  Now I want to create "symbols" that each button will call.  Is there a "correct" way to do this?
    I know I could add a small rectangle off stage, create a symbol from it and then remove it from the stage and create what I want.
    Is there a better way?
    Just curious :-)
    James

    Hey James,
    You can also create symbols and then export them and reuse them in other compositions.
    I usually create all my symbol elements, right-click on all the divs and then convert to symbol. then, if it is something I think I could reuse somewhere else, I export it.
    But different people have different ways of doing things.

  • Flash Pro CS6 crashes when creating symbol

    Okay...here's one I gotta share. I'm building some banner ads for a client. I open up Flash Pro CS6. I create a square on the stage. And when I right-mouse click on the drawing, choose Create Symbol...Flash completely locks up. I get that little Windows 7 'tink' in my speakers..and nothing. I cannot create a symbol of any kind. The program completely locks up.
    So...I uninstall the entire CS6 suite...reinstall with latest installers...and same result.
    BUT....if I put a graphic on the stage...go to the timeline...and try to apply a motion tween..flash alerts me that it needs to be a symbol and converts it to a movie clip for me...no errors.
    I'm on Windows 7, 64 bit, 16 G ram. So that ain't the problem. I tried in vane to get somebody on the phone at adobe....I knew that would be a waste of time.
    I've been using adobe software forever. And though it is frequently error and crash prone I can usually count on an uninstall squaring things away. Not this time. And I have no cause and effect to point to. I was using Flash a couple of weeks ago no problem...and now...unusable.
    If there's anyone out there reading this post...I'd really be interested in a solution.

    The only thing that could´ve changed are the settings on my mac...
    Sounds like this might be your trouble?
    I run a pc... no help to you.
    Optimizing for performance: Adobe Premiere Pro and After Effects
    http://blogs.adobe.com/aftereffects/2011/02/optimizing-for-performance-adobe-premiere-pro- and-after-effects.html

  • Is it possible to change an ID of a newly created Symbol

    after
    var item = sym.createChildSymbol("image0", "container");
    can I change the new symbol's ID?
    item.getSymbolElement().attr("id",newID);
    doesn't work.

    Try setVariable, not sure if setVariable is only limited to Arrays, this is how i manipulate Ids for newly created symbols in arrays
    item.setVariable("id", "newID");

  • Can't create Symbols

    Hello,
    I am currently building a website on Edge Animate and have to deal with a very strange bug. The project contains various symbols on the stage. Everytime, when I want to create a new symbol, other several symbols disappear and I have no chance to make them visible again. But when I remove the new created symbol, the other symbols reappear again. So curently I am not able to create new symbols because older ones mysteriously disappear. Which means, I can no longer work on that project.
    Does someone know, what the reason could be? Thanks in advance.

    It sounds like the offending Symbol zindex is at the top of the other symbols and 'covers' the others below it? Does this sound about right?
    Please share a .zip file of the the project for others to troubleshoot the issue.
    Darrell

  • Is it possible to create input ready query with free characteristics ?

    Hi All,
    Is it possible to include characteristics restricted with variables in free charatceristics panel to make input ready query?
    I am trying to create input ready query with above practice but unable to make query as input ready.
    I have created input ready query on aggregation level. If I include characteristics restricted with variables in rows or filter then it is working fine. .ie. I am able to input entries at runtime of query.
    Kindly help me out to find the solution as I have to include characteristics in free characteristics panel.

    Hi Tilak,
    Thanks for reply.
    As per my knowledge, Every characteristics which is included at aggregation level should be included in either rows or filter level in query designer.
    But as per my business requirement I have to include the characteristics restricted with variables( in default values only) in free characteristics. But the problem is if I do so the query runs in display mode not in input mode.
    So kindly help me if you have any solution for above scenario.
    ---Shamkant

  • Creating symbol removes some layers

    I am having some layers (without content) removed that have sublayers with content collected into them when creating symbols from a set of layers. Why does this occur and what is the exact expected behavior?
    I am presuming layers without content on them directly are stripped? Has this been changed in CS6?

    What Monika means is that you cannot have a layer without content if that layer has sublayers. Show a screen capture of the Layers panel with all the layers open of the original and what happens after you make the symbol.

  • Addressing dynamically created symbols

    I'm not sure what's the best way to address a specific dinamically created symbol because I don't see in Edge's API any way to get the symbol's instance name. The .getSymbol() method would be the easiest way to do it, but it takes the symbol "instance" name and I don't know which one it is. When I use .createChildSymbol() I just pass the symbol "type" name and the parent element name to be put inside but nothing about the symbol instance name that's been created. The .getChildSymbols() method doesn't help much because it retrieves "all" direct children instances found, and I have more than one and of different types.
    I need to get one specific symbol among several I created dinamcally, so how should I do it best?
    I'm thinking about using .getChildSymbols() and loop through them all, get the DOM of each symbol with .getSymbolElement(), then use the "class" attribute to at least identify the different types of children symbols retrieved. I now have a subset of children-brothers (symbols of the same type = class) and I can walk through them. At this point, my only hope to distiguish them is the z-index parameter I passed when I created the symbols using .createChildSymbol().
    One other option would be to "save" the returned handler to each symbol created with .createChildSymbol() in an object like this { symbol: handler, name: "any name", created: "date/time", ... } and save them in an array of objects.
    Any better ideas?

    Hi juicy_life,
    store it into a symbol variable instance that I know will persist (the stage, maybe)
    Looks like a global variable
    It's just annoying you can get a symbol manually added to your edge animation by its "name" using .getSymbol(), but there is not an easy way to use that function with a dinamically created symbol
    May be are you also an AS3 coder used to search through the display list accessing display objetc containers either by index (getChildAt()) or by name (getChildByName()).
    mySym.aSymbolInstances will give you an array with all "names" when you create symbols with .createChildSymbol().
    Thank you for this helpful information. I didn't know about it.
    "name" (ID), something like this: #eid_1379485757227_mySymType
    For a manually instantiated symbol symB, nested in symA, itself instantiated in the Stage Symbol, the fully qualified name (ID) is Stage_symA_symB.
    It's useful to write a global function for the behavior (on click for example) shared by a group of buttons, provided you adopt a naming convention btn1, btn2, etc. Passing the event objet to that function, you can then recover the number of the clicked button via
    evt.target.getAttribute("ID").substr()
    This abstraction avoids duplicating the same code (differing only by the button number) on each button.
    Gil

  • How to Create Symbolic link using pure Java code?

    Hi,
    I would appreciate if someone can tell me how to create symbolic link using JAVA API. I have looked into many forums but couldn't get a better answer.

    Java is likely not the tool to use here, as symlinks are not present in Windows while "pure" Java attempts to be platform independent. You could use Runtime.exec to execute the ln -s command
    http://forum.java.sun.com/thread.jspa?threadID=664475&messageID=3892685
    Good Luck
    Lee

Maybe you are looking for

  • What's the best iMac cleaning software

    What's the best iMac cleaner for optimizing disk performance

  • HTMLB Forms and Events

    Hi All, I have an HTMLB form where I have a submit button with an onClientClick javascript check function. When I hit submit, the javascript executes, finds an error and then allows the form to go on with processing which is what I do not want to do.

  • Is it possible to downgrade your I phone 4s to ISO 6?

    I would just like to know if i can downgrade my iphone 4s to ISO 6, just for a change?

  • Why is there a microphone icon in the middle of my screen?

    Just recently, a large microphone image has appeared in the middle of my Mac mini screen (see partial screen shot). It stays in front of all open windows, and while transparent, is very disruptive. What is this and how do I remove it?

  • I am a new user

    Hi I am a new user to Labview and really keen to develop my skills on labview. I am planning to take a basic training from NI instruments and the following courses which i have decided to do. Please suggest me whether it is the right way to move forw