A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Drawing in Flex

  1. #1
    Member
    Join Date
    Jun 2006
    Location
    Croatia
    Posts
    90

    Drawing in Flex

    I would like to "draw" simple shape like rectangle over an loaded image inside Image component. I don't want to alter loaded image, just to draw a rectangle for example over it with possibility to later click and interact with it. I have no idea where to start since i have no experience with drawing in Flex. What would be the best way to do that? I would really appreciate it if somene can point me in right direction.

    thanks in advance

  2. #2
    Interactive Developer
    Join Date
    Oct 2007
    Location
    Saint Louis
    Posts
    10

    Drawing API Tutorial

    blu3,
    I posted a tutorial/example on how to use the AS 3 Drawing API on my blog site:
    http://tdotblog.info/?q=node/19

    Basically, you create a Shape object. Use drawRect of its graphics object and attach it to an empty UIComponent. Lastily you can attach the UIComponent to anything you want.

  3. #3
    Member
    Join Date
    Jun 2006
    Location
    Croatia
    Posts
    90
    Thank you for tutorial, it's really useful. I have one question though, i drawed the rectangle shape by defining 'UIComponent' object and then used its 'graphic' property which allowed me to use 'drawRect' and other drawing methods. Is there a reason why i should be using Shape object like you suggested over this method i used?

    thanks once again,
    best regards

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