Sinusoid Component II
 sinusoidComponentII004view, link (11.5 KB, 400200) source (204.5 KB)Thu, 21 Sep 06, 9:39am CDT 
 

Slight changes have been made to the component: a change in how the size is set when attaching using attachMovie and the inclusion of more embedded characters for the default label.

Besides these changes to the component this demonstration swf has been changed so that the appearance of the example sinusoid can be set using flashvars. The width and height of the component will adjust to the size of the stage (ie. the swf size specified in the embedding html block).

All of the following flashvars are optional:

  • amplitude - in pixels, default is 60
  • wavelength - in pixels, default is 80
  • offset - in pixels, default is 0
  • showAxis - can be 'T' or 'F' (or '1' or '0'), default is 'T'
  • curveThickness - default is 1
  • curveColor - in hex (without '#' or '0x' in front), default is '999999'
  • curveAlpha - default is 100
  • axisThickness - default is 1
  • axisColor - in hex, default is 'cccccc'
  • axisAlpha - default is 100

Labels are added at positions posZ where Z denotes the label number, running consecutively from 1. The position should be given in pixels. Each label can be customized with the following optional flashvars:

  • colorZ - in hex, default is 'd00000'
  • textZ - default is no text
  • textAngleZ - in degrees clockwise from up, default is 0
  • textRadiusZ - in pixels, default is 7
  • textSizeZ - in points, default is 12
  • dotRadiusZ - in pixels, default is 3

 
 sinusoidComponentII003   Mon, 18 Sep 06, 3:38pm CDT 
 

notes:

amplitude, wavelength, offset - These properties determine the shape of the curve. Values are in pixels.

width, height - These properties set the dimensions of the plot area.

addLabel(linkageName, name, position, initObj, depth) - This function adds a label (movieclip) to the curve. If the linkage name is null or undefined the "SCII Default Label" found in the resources folder is used. name should be a valid actionscript identifier since it will be used to provide a reference to the movieclip. The position is the x-coordinate of the label. The optional argument initObj will be used when attaching the label movieclip. The last argument, depth, is also optional.

The "SCII Default Label" movieclip has the following properties:

  • labelColor - the color of the label (both the text and dot)
  • text - the text to place next to the label
  • textAngle - in degrees, clockwise from up, default is 0
  • textRadius - approximate distance, in pixels, between the text and the dot, default is 7
  • textSize - point size of text font, default is whatever the text size is in the embedded font field
  • dotRadius - radius of dot, in pixels, default is 3

These properties can be set by defining them on an initObject and passing it to addLabel. Afterwards, they can be set on directly on the the movieclip instance. Call update on the label movieclip after changing these properties.

setLabelPosition(name, position) - Sets the position (x-coordinate in pixels) of a label.

removeLabel(name) - Removes the label.

showVerticalAxis,showHorizontalAxis - Properties toggle visibility of the axes.

setAxisStyle(thickness, color, alpha) - Sets the linestyle of the axes. Use null to leave a parameter unchanged.

setCurveStyle(thickness, color, alpha) - Sets the linestyle of the sine curve. Use null to leave a parameter unchanged.