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 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.