5 Replies Latest reply on Apr 24, 2006 10:05 AM by blemmo

    ACTIONS IN FRAME

    xJaNx
      i have an MC on frame 1 i have the same MC on frame 5
      what i need to do is script it out so that i can
      have it fade from 0 opacity in frame to 100 opacity in frame 5

      this is what is in the actions frame

      a_mc._alpha=1;

      but now i just dont know how to code it so it will fade in completely into frame 5

      i cant use frame movie tweens because this is going on the web for a banner that is 30 K and needs to be very small in filze size overall so i need to use efficient tools


      can anyone help
        • 1. Re: ACTIONS IN FRAME
          xJaNx Level 1
          if anyone can help i would appreciate it
          • 2. Re: ACTIONS IN FRAME
            xJaNx Level 1
            can anyone on this board help?
            • 3. ACTIONS IN FRAME
              blemmo Level 1
              You could use onEnterFrame. In frame 1, place this code:

              _root.onEnterFrame = function(){
              a_mc._alpha += 20;
              if (a_mc._alpha >= 100) {
              delete this.onEnterFrame;
              }
              }

              So if you start with alpha = 0 in frame 1, it increases by 20 each frame and has 100 in the 5th frame. Then the event is deleted.

              cheers,
              blemmo
              • 4. Re: ACTIONS IN FRAME
                xJaNx Level 1
                IT GIVES ME AN ERROR

                _root.onEnterFrame = function(){
                a_mc._alpha += 20;
                if (a_mc._alpha >= 100) {
                delete this.onEnterFrame;
                };
                _root.onEnterFrame = function(){
                b_mc._alpha += 20;
                if (b_mc._alpha >= 100) {
                delete this.onEnterFrame;
                };
                _root.onEnterFrame = function(){
                c_mc._alpha += 20;
                if (c_mc._alpha >= 100) {
                delete this.onEnterFrame;
                };

                THAT IS THE CODE IM USING

                THIS IS WHAT IT SAYS

                "**Error** Symbol=radiate_mc, layer=Aktionz>, frame=1:Line 11: Statement block must be terminated by '}'
                _root.onEnterFrame = function(){

                **Error** Symbol=radiate_mc, layer=Aktionz>, frame=1:Line 15: Syntax error.
                };

                **Error** Symbol=radiate_mc, layer=Aktionz>, frame=1:Line 6: Statement block must be terminated by '}'
                _root.onEnterFrame = function(){

                **Error** Symbol=radiate_mc, layer=Aktionz>, frame=1:Line 15: Syntax error.
                };

                **Error** Symbol=radiate_mc, layer=Aktionz>, frame=1:Line 1: Statement block must be terminated by '}'
                _root.onEnterFrame = function(){

                **Error** Symbol=radiate_mc, layer=Aktionz>, frame=1:Line 15: Syntax error.
                };

                Total ActionScript Errors: 6 Reported Errors: 6"


                dont know what to do
                • 5. Re: ACTIONS IN FRAME
                  blemmo Level 1
                  Just add the missing }.
                  Currently you overwrite the event 3 times; it would only use the last part and fade in c_mc. If you want all 3 mcs faded in simultaneously, put it all in one event definition:
                  --
                  _root.onEnterFrame = function(){
                  a_mc._alpha += 20;
                  b_mc._alpha += 20;
                  c_mc._alpha += 20;
                  if (c_mc._alpha >= 100) {
                  delete this.onEnterFrame;
                  };
                  } //<-- that one was missing
                  --