
206
CHAPTER 11
option on this tab. When enabled, the FDT will watch for file changes and automatically perform the
conversion in the background. When you step back to Flash, you don’t have to remember to click
convert in the FDT.
Figure 11‑9. FDT ActionScript conversion
Following is the original CreateRectangle function introduced earlier in the chapter, housed in Draw
Rect.jsf:
function CreateRectangle(left, top, width, height, cornerRadius, color)
{
var rect = new Object();
rect.left = left;
rect.top = top;
rect.right = left + width;
rect.bottom = top + height;
fw.getDocumentDOM().addNewRectanglePrimitive(rect, cornerRadius);
fw.getDocumentDOM().setFillColor(color);
}
The following code listing shows the contents of Draw Rect.as after being converted to an ActionScript
variable using FDT:var jsfCode:String = "":
+ "function CreateRectangle(left, top, width, height, ➥
cornerRadius, color)\n"
+ "{\n"
+ " var rect = new Object();\n"
Kommentare zu diesen Handbüchern