• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

drawing panel...

Community Beginner ,
Jun 02, 2013 Jun 02, 2013

Copy link to clipboard

Copied

Hello,

I am planning to create a simple drawing panel by using AS3. I want to prepare several color buttons upon the pressing of each one will the user be able to select a drawing color.

I have had the code like this.

var spriteyellow: Sprite = new Sprite();

addChild(spriteyellow);

stage.addEventListener(MouseEvent.MOUSE_DOWN, yellowing);

function yellowing(e:MouseEvent){

    spriteyellow.graphics.lineStyle(1, 0xffdd33);

    spriteyellow.graphics.lineTo(mouseX, mouseY);

}

There are also problems with this code: 1) I cannot set the thickness of the line (I want it to be adjustable). 2) I cannot start from anywhere on the screen. It always starts from the default left upper corner.

Barring the two problems above, this code so far only draws lines on the screen. I, also, do not know how I sould connect the selection buttons with conditional statement that will change with each color button itself.

If anyone could help, I would be very happy.

Best Regards,

Cagri Kasap

TOPICS
ActionScript

Views

460

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 02, 2013 Jun 02, 2013

Copy link to clipboard

Copied

Try searching Google for some "AS3 drawing tutorials".  Here is a link to the first result from that search:

http://active.tutsplus.com/tutorials/games/create-a-basic-drawing-application-in-flash/

It provides the code in the discussion as well as source files.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 02, 2013 Jun 02, 2013

Copy link to clipboard

Copied

LATEST

Hello,

Thank you very much for your reply but that one is too complicated for me.

I cannot understand much from it. I need a simpler version that will

explain to me how to do a basic color picker.

Thank you for your time.

Cagri Kasap

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines