1 Reply Latest reply on Feb 16, 2014 6:13 AM by hemanthR

    Get y position for conditional action

    Matbathome Level 1

      Here's my site I'm working on:

      http://matthewtbrown.com/mercerworld/mercerworld1.html

       

      I haven't done any scripting programming in a long time (I used to do some Actionscript, but wasn't a pro).

       

      Anyway, if click on the People icon, two map pointer icons drop down, which works great. I want the map pointer icons to move up when I roll off the People icon, but only if they are already down, not if they aren't.

       

      So, I guess I need some sort of conditional statement and can't find any sort of explanation for doing this.

       

      Here's what I'm thinking

      Assign a variable to the map pointer symbol when it reaches a certain point.

      Then test to see if the map pointer symbol is that certain variable.

      If true, then activate the label on the timeline of the symbol, which moves the map pointer icon up.

       

      Here's what kind of works. It doesn't have a conditional statement, so it moves the map pointer icon up whenever you roll off the People icon.

      var mySymbolObject = sym.getSymbol("resource_group");

       

       

      mySymbolObject.play("Resource_up");

       

       

      var mySymbolObject = sym.getSymbol("distribution");

       

       

       

       

      mySymbolObject.play("dist_up");

        • 1. Re: Get y position for conditional action
          hemanthR Adobe Employee

          ON composition complete create a variable

          sym.setVariable("pointersMoved", false);

           

          In the mouse over for the people button i.e. before sending the pointers down set the variable created previously to true

          sym.setVariable("pointersMoved", true);

           

          Now roll of event for the people button check the variable before playing  sending the pointers up

          var pointersMoved =  sym.getVariable("pointersMoved");

          if(pointersMoved){

          var mySymbolObject = sym.getSymbol("resource_group");

           

           

          mySymbolObject.play("Resource_up");

           

           

          var mySymbolObject = sym.getSymbol("distribution");

           

           

           

           

          mySymbolObject.play("dist_up");

          sym.setVariable("pointersMoved", false);

           

          }

          1 person found this helpful