7 Replies Latest reply on Jun 12, 2006 5:28 AM by DazFaz

    lift arrow effect

    micheal_newby
      Hello there,
      I am trying to make a lift pointer effect. If you press the buttons the arrow wil rotate to a number.
      http://www.webdesign-cs.com/lifttest/lift.swf (lift.fla) is the original fla file.

      Is there a way through actionscript that when the arrow point for example nr. 3 and i press the first button that it knows
      to go from 3 to 0. And if you are on 4 and you want to go to 2, that is uses the animation from 4 to 2.

      (ps. if you noticed, the second button has a pause of some seconds). I also wanted to create this pause before moving.

      I really don't know where to begin from here, maybe someone has expierence with this?

      Kind regards,

      Micheal.
        • 1. Re: lift arrow effect
          DazFaz Level 1
          Hi Ive created a fla that I think will do the job for you. Do you have an email?
          • 2. lift arrow effect
            micheal_newby Level 1
            Hello DazFaz,
            I am curious about your fla file, if you want you can e-mail it to: **************
            I hope it can do it, because i counted that i will have to make 5x4 = 20 combination of animations..

            Regards,
            Micheal.
            • 3. Re: lift arrow effect
              DazFaz Level 1
              Hi Micheal,

              Ive sent you the fla. It might be an idea to take your email off here now. If you have any problems then let me know.

              DazFaz
              • 4. Re: lift arrow effect
                Level 7
                Also, Micheal - if the solution works, you might want to post the
                working code or concept here, so others searching for help on this issue
                who might find this thread can learn from what you've found.

                DazFaz wrote:
                > Ive sent you the fla. It might be an idea to take your email off here now. If you have any problems then let me know.
                • 5. lift arrow effect
                  micheal_newby Level 1
                  Thanks DazFaz,,

                  I forward the mail to my other e-mail adres and i was able to open the attatchment.
                  I really don't know why hotmail does not allow me to download the attatchment?

                  What a brilliant way to make this rotation dynamically! That is really mindbreaking!
                  Is there a way to put somewhere in this actionscript a line where a pause of 10 seconds
                  can be made? Because i want to create lift doors, so when i push this button the lift doors will
                  close first (that will take about 10 seconds) and then the arrow function should be activated.

                  Do you know where to put a function to wait about 10 seconds for running ?

                  Kind Regards,

                  Micheal

                  • 6. lift arrow effect
                    micheal_newby Level 1
                    Dazfaz solution on making this dynamically through actionscript. (I replaced the source files, so it works fine now)

                    Does anyone know how to place an pause of 10 seconds in this actionscript before running the rotation effect?

                    //******************************************************************//
                    // this array contains the angles on which the dial should //
                    // be rotated to for if to point at each number. //
                    // The dial starts at 0 degress //
                    //******************************************************************//
                    var floorNumberLocations:Array = new Array(
                    {floors:"0"},//Floor 0
                    {floors:"35"},//Floor 1
                    {floors:"80"},//Floor 2
                    {floors:"120"},//Floor 3
                    {floors:"160"}//Floor 4
                    )
                    speed = 1//the speed that the dial moves
                    //**********************************************************************//
                    // This function is called when a button is pressed
                    // Step 1
                    function whichFloor(foorNumber){// Step 2 "foorNumber" is passed a number from the botton
                    this.onEnterFrame = function(){
                    if(wijzer.liftArrow._rotation!=floorNumberLocations[foorNumber]["floors"]){// if the dial is not equal to (!=) the floor number in the array then...
                    if(wijzer.liftArrow._rotation>floorNumberLocations[foorNumber]["floors"]){//if the dial is set at an angle greater that the number in the floor array then...
                    wijzer.liftArrow._rotation = wijzer.liftArrow._rotation-speed// ....rotate the dial by reducing the rotation by "speed" each time
                    }else if(wijzer.liftArrow._rotation<floorNumberLocations[foorNumber]["floors"]){//if the dial is set at an angle less than the number in the floor array then...
                    wijzer.liftArrow._rotation = wijzer.liftArrow._rotation+speed// ....rotate the dial by increasing the rotation by "speed" each time
                    }
                    }else{
                    this.onEnterFrame = Void//once the rotation of the dial gets to the right angle this nulls out the onEnterFrame function (effectively stops) until its needed again when a button is pressed
                    }
                    }
                    }
                    //**********************Button Functions********************************//
                    // each of the floor buttons on the stage now have the //
                    // following names as so I can apply functions to them from here //
                    //**********************************************************************//
                    F0.onRelease = function(){
                    whichFloor("0")
                    }
                    F1.onRelease = function(){
                    whichFloor("1")
                    }
                    F2.onRelease = function(){
                    whichFloor("2")
                    }
                    F3.onRelease = function(){
                    whichFloor("3")
                    }
                    F4.onRelease = function(){
                    whichFloor("4")
                    }
                    //**********************************************************************//
                    • 7. Re: lift arrow effect
                      DazFaz Level 1
                      Hello again. Ive aaded the pause timer to this fla and emailed it to you. Again fully commented.

                      Cheers