A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: paletteMap color program

  1. #1
    Game Master ConnELITE's Avatar
    Join Date
    Apr 2005
    Location
    United States, DC
    Posts
    474

    paletteMap color program [f8]

    Hi, I've been trying to make a coloring system where users can take bitmaps and change them into the color of there choice. I remembered the paletteMap function which had an example of changing a bitmap square from green to red and from red to green so I figured I could use this.
    (doc for paletteMap: http://livedocs.adobe.com/flash/8/ma...=00001962.html)

    I have to say though I know nothing about this function or much about colors for that matter. I tried this at first...

    PHP Code:
    mc.onPress = function() {
        var 
    redArray:Array = new Array(256);
        var 
    greenArray:Array = new Array(256);
        var 
    blueArray:Array = new Array(256);

        for(var 
    0255i++) {
            
    redArray[i] = color;
            
    greenArray[i] = color;
            
    blueArray[i] = color;
        }



        
    myBitmapData.paletteMap(myBitmapData, new Rectangle(0010040), new Point(00), redArraygreenArrayblueArraynull);

    The variable color was equal to the hexadecimal value of the color chosen by the user. The function above, however, did not work. It changes the bitmap into weird colors, not the ones that were chosen and I have no idea why.

    I've been messing around with it for some time now. Does anyone know what I could do?
    Last edited by ConnELITE; 12-04-2007 at 09:40 PM.
    BC

  2. #2
    Game Master ConnELITE's Avatar
    Join Date
    Apr 2005
    Location
    United States, DC
    Posts
    474
    oh yeah, I forgot to mention I'm using flash 8.
    BC

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