A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: simple syntax issue i think....

  1. #1

    simple syntax issue i think....

    making a basic coloring book,
    the paint brush is coloring just fine, but the target areas are not.
    any help on how to write this?

    code:

    startDrag(_root.paintbrush, true);

    _global.chosencolor = 0x000000
    myColor = new Color(_root.paintbrush.paintbrushColor);

    _root.black.onRelease = function() {
    myColor.setRGB(0x000000);
    chosencolor = 0x000000
    };
    _root.blue.onRelease = function() {
    myColor.setRGB(0x3300ff);
    chosencolor = 0x3300ff
    };
    _root.green.onRelease = function() {
    myColor.setRGB(0x33ff00);
    chosencolor = 0x33ff00
    };
    _root.red.onRelease = function() {
    myColor.setRGB(0xcc3300);
    chosencolor = 0xcc3300
    };


    _root.area1.onRelease = function() {
    area1.setRGB(chosencolor);
    };
    _root.area2.onRelease = function() {
    area2.setRGB(chosencolor);
    trace(chosencolor)
    };

    Attached Files Attached Files

  2. #2
    dmacker = new Person()
    Join Date
    Jan 2005
    Location
    Woburn, MA
    Posts
    143

    try this

    I added this code to each of the 2 circles to be "colored":

    on (release) {
    circleColor = new Color(this);
    circleColor.setRGB(_root.chosencolor);
    }

    (see attached file: "coloring_book_v2_NEW.fla")

    Hope this helps.

  3. #3
    dmacker = new Person()
    Join Date
    Jan 2005
    Location
    Woburn, MA
    Posts
    143

    this time I attached the file... no really

    Sorry about that.
    Attached Files Attached Files

  4. #4
    Perfect... thanks dmacker
    I worried my way around it but never quite got there
    thanks again

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