To test the Dial component:
In the Dial.fla file, choose the Dial component in the library and choose Convert to Compiled
1.
Clip from the Library options menu.
A compiled clip is added to the library with the name Dial SWF.
Note: If you've already created a compiled clip (for example, if this is the second or third time
you're testing), a Resolve Library Conflict dialog box appears. Choose Replace Existing Items to
add the new version to the document.
Drag Dial SWF to the Stage on the main Timeline.
2.
You can resize it and set its value property in the Property inspector or the Component
3.
Inspector. When you set its value property, the needle's position should change accordingly.
To test the
property at runtime, give the dial the instance name dial and add the
4.
value
following code to Frame 1 on the main Timeline:
// position of the text field
var textXPos:Number = dial.width/2 + dial.x
var textYPos:Number = dial.height/2 + dial.y;
// creates a text field in which to view the dial.value
createTextField("dialValue", 10, textXPos, textYPos, 100, 20);
// creates a listener to handle the change event
function change(evt){
// places the value property in the text field
// whenever the needle moves
dialValue.text = dial.value;
}
dial.addEventListener("change", this);
Choose Control > Test Movie to test the component in Flash Player.
5.
Building your first component
923
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?