The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.

flash question

ufoufo Registered User regular
edited December 2006 in Help / Advice Forum
hi i have a quick question.

i am currently learning flash and want to create a file where its a pseudo paint by numbers. i have a bunch of rectangles which are numbered and i modified them all to be buttons so that in the down state the alpha level for color goes to 100% essentially filling them in. My question is I cant seem to figure out how to have it hold that change once i click.

I would like to be able to click on each individual rectangle and for the color to stay and then have to have it so i have to click it again for it to lose its color. I know this has to be possible right? im new to flash so yeah this is probably so easy its laughable. thanks in advance.

ufo on

Posts

  • Fleck0Fleck0 Registered User regular
    edited December 2006
    ufo wrote:
    hi i have a quick question.

    i am currently learning flash and want to create a file where its a pseudo paint by numbers. i have a bunch of rectangles which are numbered and i modified them all to be buttons so that in the hit state the alpha level for color goes to 100% essentially filling them in. My question is I cant seem to figure out how to have it hold that change once i click.

    I would like to be able to click on each individual rectangle and for the color to stay and then have to have it so i have to click it again for it to lose its color. I know this has to be possible right? im new to flash so yeah this is probably so easy its laughable. thanks in advance.

    my actionscript is really rusty, but you could make a duplicate of each shape symbol's uncolored form and fill it in with whatever color you want

    then when an uncolored shape button is clicked you have it swap with the colored version, would also work fine if you want them to be able to click a colored in shape to take the color out

    edit: another way to do it that would use less actionscript or at least be easier, would be to make each shape a movie clip with 2 frames. one the uncolored shape and the other one colored in.

    then when the shape is clicked you have it advance to the second frame.

    my scripting is still too rusty to remember exactly what you would enter to do this, but you'd want to have a pause on both frames, then just add the (onmousedown) <whatever the command is to advance the clip>

    basically... I know it's vague but hopefully it'll help

    Fleck0 on
    steam_sig.png
  • freekfreek Registered User regular
    edited December 2006
    You could set variables. When the button is clicked have it equal 1. then set a function that if the rectangle equals 0, the fill is #000000, but if it's 1, the color is #CCCCCC. It's not terribly easy but not too hard either.

    I remember doing a project like this, but can't remember exactly how I did it though this seems like the way to go.

    EDIT: this might help

    http://www.kirupa.com/developer/actionscript/color.htm

    I love kirupa.com

    freek on
  • ufoufo Registered User regular
    edited December 2006
    thanks for the help so far however i wont lie i am completely lost. i am not advanced at all in flash so yeah... im going to try but please keep the helpful hints coming

    ufo on
  • JasconiusJasconius sword criminal mad onlineRegistered User regular
    edited December 2006
    First of all, "button" symbols are a sin against man. Buttons are just crunched down Movie clips but more restrictive.


    The "Down" frame is reverting because its only active while "Down"

    Create your button in a movie clip and add an onRelease command that changes the color to what you want. That way when its clicked it stays that way.

    If you want it to be able to revert back to the original color, then I think you can create a conditional that if its already the pressed color, then it goes to an onRelease that puts it back, and so forth.

    I think one of the above suggestions would also work. There's more than one way to skin a cat. Your first mishap was using the button symbol, IMO

    Jasconius on
    this is a discord of mostly PA people interested in fighting games: https://discord.gg/DZWa97d5rz

    we also talk about other random shit and clown upon each other
Sign In or Register to comment.