views:

226

answers:

1

I have a simply xml ui:

<dialog title="Select Symbol" buttons="accept, cancel">
    <vbox>
     <targetlist id="target_symbol" height="300" width="400" required="true" class="movie clip" />
    </vbox>
</dialog>

How can I get the result of once the user pressed accept ?

I have somthing basic like:

var doc = fl.getDocumentDOM();
var symbolDialog = doc.xmlPanel(fl.configURI + 'Javascript/GetSymbolDialog.xml');
    if(symbolDialog.dismiss == 'accept')
    fl.trace(symbolDialog.target_symbol);

And all I get is undefined.

symbolDialog.target_symbol.value does not exist.

I have looked in the chapter about XMLUI in the Extending Flash MX 2004 book, but all the properties listed there under targetlist are: id, height, width, class and required.

How do I get the selection from a targetlist ?

A: 

Just in case people from the distance future of 2010 want to travel through time to 2004 and play with this, here is the answer, via Todd Yard, one of the authors of Extending Flash MX 2004 :

it looks like you need to define a property that is the same id as your targetlist, then you can access it through xmlui.get(propertyName).

so the revised xml code should look like this:

<dialog title="Select Symbol" buttons="accept, cancel">
    <properties>
     <property id="target_symbol" default="_parent" />
    </properties>
    <vbox>
        <targetlist id="target_symbol" height="300" width="400" required="true" class="movie clip" />
    </vbox>
</dialog>

And that's it.

fl.trace(symbolDialog.target_symbol);

will just work.

George Profenza
What do people use in 2010?
Dmitry
@Dmitry dunno' but jsfl doesn't seem all that trendy to other anymore, maybe it's just me. Maybe some new spark will start with the jsx procedural drawing tools in cs4, but with little documentation, I have doubts.
George Profenza