A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Help with rotation

  1. #1
    Junior Member
    Join Date
    Mar 2015
    Posts
    4

    Exclamation Help with rotation

    Hey guys, im in trouble, im doing a webradio player for a client my deadline was on friday and im still stucked on the volume slider.

    Well the layout of the player is this:
    x29dzgqa.jpg

    And i need to do this green button, slide around de circle to get more or less volume.

    Ive already have a code, that do this, but im not able to customize it, i need that it runs on clockwise, and on my code it is running counterclockwise

    Well this is my code:
    Code:
    onClipEvent (enterFrame) {     if (_root.motion)     {         this.thisx = this._x;         this.thisy = this._y;         this.lastx = _parent._xmouse;         this.lasty = _parent._ymouse;         this.xdif = this.thisx-this.lastx;         this.ydif = (this.thisy-this.lasty)*-1;         this.finalrot = Math.atan2(this.xdif, this.ydif);         this.finalrot = ((this.finalrot*180)/Math.PI)-180;         this.finalrot = this.finalrot+360;             if (this.finalrot >= 45 and this.finalrot <= 270)     {             this._rotation = this.finalrot;         }     } }


    Exclamation Hlp with rotation
    Hey guys, im in trouble, im doing a webradio player for a client my deadline was on friday and im still stucked on the volume slider.

    Well the layout of the player is attached here.

    And i nedd to do this green button, slide around de circle to get more or less volume.

    Ive already have a code, that do this, but im not able to customize it, i need that it runs on clockwise, and on my code it is running counterclockwise

    Well this is my code:

    ActionScript Code:

    onClipEvent (enterFrame) { if (_root.motion) { this.thisx = this._x; this.thisy = this._y; this.lastx = _parent._xmouse; this.lasty = _parent._ymouse; this.xdif = this.thisx-this.lastx; this.ydif = (this.thisy-this.lasty)*-1; this.finalrot = Math.atan2(this.xdif, this.ydif); this.finalrot = ((this.finalrot*180)/Math.PI)-180; this.finalrot = this.finalrot+360; if (this.finalrot >= 45 and this.finalrot <= 270) { this._rotation = this.finalrot; } } }



    I dont know nothing about actionscript, do you guys can help me???

    thanks a lot

  2. #2
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Hi,

    it would help a lot of if you could post your FLA file as well, as I'm scratching my head over where to put your code.

    Upload it to TinyUpload and post the link here
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  3. #3
    Junior Member
    Join Date
    Mar 2015
    Posts
    4
    Oh, sorry, heheheh, its here: http://s000.tinyupload.com/download....97207490419066

    Into te stage, the green butto is a movieclipe into the container movieclipe, then you click on the green button and select actions the code is there

    Thank you very much

  4. #4
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,


    without having looked at your file yet, try here http://www.*******.com/tutorials/volume-controller.htm
    link does not work, replace ******* with so think - no space

    or look here

    http://board.flashkit.com/board/show...Volume-Control
    Last edited by fruitbeard; 03-02-2015 at 09:39 AM.

  5. #5
    Junior Member
    Join Date
    Mar 2015
    Posts
    4
    Thank you guys, this last link sent by fruitbeard saved my life.

    Thank you very much

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