Home » questions » Flash Question?

Flash Question?

2006-08-01 13:01:18, Category: Programming & Design
in the following script: on (release) { img4_mc.onEnterFrame = function() { img4_mc._alpha -= 5; if (img4_mc._alpha <= 0) { img4_mc._visible = false; delete img4_mc.onEnterFrame; } }; } on (release) { img3_mc.onEnterFrame = function() { img3_mc._alpha += 5; if (img3_mc._alpha <= 100) { img3_mc._visible = true; } }; } img3_mc fades in before img4_mc fades out, can anyone tell me how I modify the code to make it so img4_mc fades out and then img3_mc fades in?

Answers

  1. Ana

    On 2006-08-01 13:12:23


    I down know if is a good idea but try to use SwapDepth to change alsio the depth of two imgs
  2. Anil K

    On 2006-08-02 00:04:44


    Your question is nor clear but I can help you. mail me your .fla file anilkumarnd@yahoo.com
  3. D

    On 2006-08-01 14:34:04


    ok, now please forgive me, its been a while since I used flash actionscripting, now since you are using an "on release" (I assume that these are BOTH buttons) function, try this idea, assign img4_mc a variable, such as 0, then when img4_mc finishes, turn the variable to 1, and have the other button only function once that variable hits one...something like this on (release) { img4_mc.onEnterFrame = function() { img4_mc._alpha -= 5; if (img4_mc._alpha <= 0) { img4_mc._visible = false; delete img4_mc.onEnterFrame; NewVariable = 1; } }; } If (NewVariable == 1) { on (release) { img3_mc.onEnterFrame = function() { img3_mc._alpha += 5; if (img3_mc._alpha <= 100) { img3_mc._visible = true; } } }; } I'm sorry if you get a syntax error here, like I said, its been a while. Hope it helps
  4. Lode Vaduh

    On 2006-08-01 13:08:28


    So, are you making a button? Just wondering. I don't know much about actionscript...I just saw your question and recognized it as actionscript... sorry though.
  5. Sherry L

    On 2006-08-01 13:04:29


    Yes your mother did do drugs while she was pregnant with you