A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Volume Control Problem

  1. #1
    Junior Member
    Join Date
    Aug 2007

    Unhappy Volume Control Problem

    Dear all,

    Can anyone pls help me- I followed a tutorial about volume control but i had errors after runtime. The following are the errors and the lines with error. Any help would be very much appreciated.

    (1)---1120: Access of undefined property slider_mc.
    (2)---1067: Implicit coercion of a value of type Boolean to an unrelated type flash.geom:Rectangle.
    (3)---1137: Incorrect number of arguments. Expected no more than 2.

    To create a sliding volume control:

    1. Using the Rectangle Tool, draw a small rectangle on the Stage, approximately 30 pixels high by 10 pixels wide.
    2. Select the Selection Tool and double-click the shape on the Stage.
    3. Press F8 to open the Convert to Symbol dialog box.
    4. Select the Button type, enter a symbol name of volume, and click OK.
    5. With the button symbol selected on the Stage, enter the instance name of handle_btn in the Property inspector.
    6. Select the button, and select Modify > Convert to Symbol.

    Be careful to select the movie clip behavior. This creates a movie clip with the button on Frame 1.
    7. Select the movie clip, and enter volume_mc as the instance name in the Property inspector.
    8. Select Frame 1 of the main Timeline, and select Window > Actions.
    9. Enter the following code into the Actions panel:

    this.createTextField("volume_txt", 10, 30, 30, 200, 20);
    volume_mc.top = volume_mc._y;
    volume_mc.bottom = volume_mc._y;
    volume_mc.left = volume_mc._x;
    volume_mc.right = volume_mc._x + 100;
    volume_mc._x += 100;

    volume_mc.handle_btn.onPress = function() {

    (2 & 3)--- startDrag(this._parent, false, this._parent.left, this._parent.top, this._parent.right, this._parent.bottom);

    volume_mc.handle_btn.onRelease = function() {
    var level:Number = Math.ceil(this._parent._x - this._parent.left);
    this._parent._parent.volume_txt.text = level;

    (1)--- volume_mc.handle_btn.onReleaseOutside = slider_mc.handle_btn.onRelease;

    The startDrag() parameters left, top, right, and bottom are variables set in a movie clip action.
    10. Select Control > Test Movie to use the volume slider.


  2. #2
    Junior Member
    Join Date
    Aug 2007
    sorry guys this is actionscript 2.Pls delete this topic to avoid confusion to other members.
    Last edited by literain; 04-28-2008 at 04:48 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center