Question

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 ?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top