Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3969670
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:59:28+00:00 2026-05-20T03:59:28+00:00

I tried this way, but it doesn’t draw on the image. Only if I

  • 0

I tried this way, but it doesn’t draw on the image. Only if I tries to draw on right border (outside the image) it working.

private var oldX:Number, oldY:Number; 
private var mode:String = "modeBrush";
   private function onMouseDown(e:MouseEvent):void { 
    oldX = e.localX; 
    ldY = e.localY; 
   } 
   private function onMouseMove(e:MouseEvent):void { 
        if (e.buttonDown) { 
       var g:Graphics = currImg.graphics; 
       var mx:Number = e.localX; 
       var my:Number = e.localY;        
           g.lineStyle(10, 0xFFFF00); 
       g.moveTo(oldX, oldY); 
       g.lineTo(mx, my); 
    }   
        oldX = mx; 
    oldY = my;  
} 
//image i'am loading at runtime by button click

 <s:BorderContainer id="everything" borderStyle="solid"  width="900" height="600">
      <s:Scroller left="2" right="2" top="2" bottom="2">
           <s:Group id="group"> 
         <mx:Image id="currImg" mouseMove="onMouseMove(event)" mouseDown="onMouseDown(event)"/>
           </s:Group>
       </s:Scroller>    
     </s:BorderContainer>

UPDATE
If I do like this, everything works great!

var line:UIComponent = new UIComponent();
    line.graphics.lineStyle(2, 0x990000, .75);
    line.graphics.beginFill(0x000000);
    line.graphics.moveTo(oldX, oldY);
    line.graphics.lineTo(mx, my);
    currImg.addChild(line);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T03:59:29+00:00Added an answer on May 20, 2026 at 3:59 am

    As I know you cannot draw line directly on a image, you need to draw on a UIComponent.

    The following link may help you:

    http://groups.google.com/group/macromedia.flex.flex_builder/browse_thread/thread/bbcfc4e3e0a2e133
    http://www.axelscript.com/2008/06/11/drawing-in-flex-using-the-uicomponent/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tried setting the background image this way, but it doesn't work. Any
I've tried to find a way to do this, but without success. I'm looking
I tried this but it doesn't seem to work,,, any Idea why not ?
I tried this, but it doesn't seem to work subtest 'catalyst scripts that should
Is there way to set @include mixin(); to variable? I tried this @mixin bg-gradient($fallback,
I am tired of working this out myself , i cannot understand the way
I tried this but it does not seem to be valid syntax. <xsl:element name=$myElementName></xsl:element>
Tried to search but no specific answers (I am very new in this)... With
Tried this: scala> 2.isInstanceOf[AnyVal] <console>:8: error: type AnyVal cannot be used in a type
Tried this: $('.link').click(function(e) { $.getScript('http://www.google.com/uds/api?file=uds.js&amp;v=1.0', function() { $('body').append('<p>GOOGLE API (UDS) is loaded</p>'); }); return

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.