A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Actionscript Drawing

  1. #1
    Junior Member
    Join Date
    Aug 2006
    Posts
    15

    Actionscript Drawing

    Hi,

    I need to develop dialog boxes with handleers like below.

    http://www.krishnakorea.com/sudhi/dialogue.bmp

    It has four handlers to drag , resize, rotate and fifth handler which is out of box to rotate it.

    I have no idea how start this development. Can anybody share a code snippet or idea to start with.

    Thanks in Advance.

    ~Sudhi

  2. #2
    var x:Number = 1; x /= 0;
    Join Date
    Dec 2004
    Posts
    549
    well, I can get you a code for rotating, but resizing...I have no idea.

    to rotate it, you would have a movie clip (whatever you want to use to rotate the box) inside another movie clip that holds the text box

    we'll call it "rotate_mc"

    we'll say something like this:

    Code:
    onClipEvent(enterFrame){
    this.onPress = function(){
    this._parent._rotation = Math.atan2(Math.sqrt(Math.pow(_parent._x-_parent._x,2)+Math.pow(_parent._y-_ymouse,2)),Math.sqrt(Math.pow(_parent._x-_xmouse,2)+Math.pow(_ymouse-_ymouse,2)));
    }
    }
    I think that should work.

    Tell me how it goes.

    ~Zippy Dee
    Ted Newman
    Z¡µµ¥ D££

    Soup In A Box

  3. #3
    var x:Number = 1; x /= 0;
    Join Date
    Dec 2004
    Posts
    549
    I just had another thought, which is that to do resizing, you could change the scale, but I think that would change the text size, too...

    You could give it a try. I'll keep looking.
    Z¡µµ¥ D££

    Soup In A Box

  4. #4
    Junior Member
    Join Date
    Aug 2006
    Posts
    15

    thanks

    Dear Zippy,

    Thanks for your response.

    I have got idea how to resize, rotate, drag a movie on a stage.


    But I dont get idea how to maintain the fifth handler, which is outside of box.

    I must able to move that on stage .

  5. #5
    var x:Number = 1; x /= 0;
    Join Date
    Dec 2004
    Posts
    549
    nested movie clips?

    I'm not quite sure what you're asking for.

    do you mean just another rotation point that is not on the corners of the box?
    Z¡µµ¥ D££

    Soup In A Box

  6. #6
    Junior Member
    Join Date
    Aug 2006
    Posts
    15
    Fifth handler means the one which is outside in below pic,

    http://www.krishnakorea.com/sudhi/dialogue.bmp

    If you observer picture , there are 4 handlers on the corner of rectangle and one in center.

    The four handlers are to resize and rotate movie, the middle one is to move movie clip ( drag and drop) . If you observer the picture there is another one ( 6th handler on smalll circle shape) which outside of rectangle.

    I need to move that as well to get differnt shape.

    If you can share little code snippet , I will be delightful.

    Thanks ,
    Sudhi

  7. #7
    var x:Number = 1; x /= 0;
    Join Date
    Dec 2004
    Posts
    549
    Ah, so you want to be able to move that to around but have the rest stay still?
    Z¡µµ¥ D££

    Soup In A Box

  8. #8
    Junior Member
    Join Date
    Aug 2006
    Posts
    15

    yes

    Quote Originally Posted by ZippyDee
    Ah, so you want to be able to move that to around but have the rest stay still?

    Yes.absolutely

  9. #9
    var x:Number = 1; x /= 0;
    Join Date
    Dec 2004
    Posts
    549
    Hmm, well... I'm not exactly sure how you would do that with AS, but I know of a program that does allow drawing. It is very bad, I will say, but there are some good things (such as that). I would not say to use it over Flash, but if you have to get something, then go for it.

    The program is 3D Flash Animator. There is a section on flashkit for it. Check it out.

    www.3dfa.com I believe. You can get a free trial that allows you to export for 7 days.

    if you need it, I can give you some codes to accomplish that so you can get it done in 7 days...

    or just find a way to do it in AS (which I suggest would be better)
    Z¡µµ¥ D££

    Soup In A Box

  10. #10
    Junior Member
    Join Date
    May 2007
    Posts
    11

    get it ,its all yours

    Check out this link you will get it all here
    http://blog.greensock.com/

  11. #11
    Senior Member
    Join Date
    Feb 2005
    Posts
    1,836
    Try using flash's drawing ability like this:
    you use: lineStyle(0x000000);
    this to move without drawing: moveTo(x,y);
    this to move with drawing: lineTo(x,y)
    and this to make curves: curveTo(curvePointx, curvePointy, anchorPointx, anchorPointy);
    also use clear() to erase everything.
    .

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