MACROMEDIA FLASH MX 2004-USING FLASH Use Manual page 470

Hide thumbs Also See for FLASH MX 2004-USING FLASH:
Table of Contents

Advertisement

// check for valid input because sending 0 or undefined to
// scaleSelection() will cause the object to disappear.
var inputIsValid = true;
if (xScale == 0 || isNaN(xScale)) {
inputIsValid = false;
}
if (yScale == 0 || isNaN(yScale)) {
inputIsValid = false;
}
// Call scaleSelection to carry out the resizing command.
if (inputIsValid ) {
fl.getDocumentDOM().scaleSelection(xScale, yScale);
}
}
Second, create a file named scale.xml and place it in your Commands folder. Place the following
code into the file and save the file:
<?xml version="1.0"?>
<dialog id="scale-dialog" title="Scale Selection" buttons="accept, cancel">
<grid>
<columns>
<column/>
<column/>
</columns>
<rows>
<row align="center">
<label value="Scale x: " control="xScale"/>
<textbox id="xScale"/>
</row>
<row align="center">
<label value="Scale y:" control="yScale"/>
<textbox id="yScale" />
</row>
</rows>
</grid>
</dialog>
The
command now appears on the Commands menu. Draw a shape on the Stage and
scale
select it with the pointer tool. If you select the
dialog box defined by scale.xml appears, as shown in the following figure:
470
Appendix B: XML to UI
command from the Commands menu, the
scale

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash mx 2004 - actionscript

Table of Contents