Announcement

Collapse
No announcement yet.

how to get numericstepper value?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    how to get numericstepper value?

    yo

    whats the syntax for getting values of click widgets in action script
    for the NumericStepper, but in general what do you do?

    eg
    a numericstepper called numstep_mc
    numstep_mc.value doesnt seem to work

    thank you

    #2
    Its always a good idea to open the class file for a given component to find stuff like this out in the future.

    That being said, value is the correct property to poll. So, assuming you have a numeric stepper on the root named 'ns', this ActionScript will trace its currently set value as it changes.

    Code:
    ns.addEventListener("change", this, "NSChange");
    
    function NSChange() {
        trace(ns.value);
    }

    Comment


      #3
      thank you
      i cant seem to get this to work, im trying to select a value then store it as a config var in an ini. it saves the ini but the value is always 0.
      perhaps someone can see the problem?
      theres a numericstepper called lapnum_mc

      actionscript, its on an actions layer if thats important
      Code:
      var lapNumber:Number;
      
      lapnum_mc.addEventListener("change", this, "NSChange");
      
      function NSChange() {
       lapNumber = lapnum_mc.value;
      }
      //........other stuff
      // on a button press this happens
      ExternalInterface.call("LapFunction", lapNumber);
      unreal script
      Code:
      class UW2EntryGame extends UTGame
            config(MyIni);
      
            var config int GameEndLap;
      
      function LapFunction(int lapNumber )
      {
      GameEndLap = lapNumber + 1;
      SaveConfig();
      }
      it fires the functions because UDKMyIni is generated
      but i get 0 every time

      the ini file
      Code:
      [UW2_Content.UW2Game]
      GameEndLap=0
      thanks for any help

      Comment


        #4
        When you test this in Fx Media Player, what value does the external interface argument display in the log? I'm guessing that part works properly.

        From what I can tell, your problem is in UnrealScript somewhere. You're adding 1 to lapNumber there, yet it still saves the value as 0 in the config file. Not sure what's wrong.

        Comment


          #5
          in the fx media player log i get this
          callback! LapFunction, nargs = 1
          arg(0) = 4
          so it must be the uscript
          hmmm....

          edit
          hang on it gets generated when the game starts not when the button is pressed
          gosh it must be some earlier experiments come to life somewhere

          thank you matt

          Comment

          Working...
          X