4 Replies Latest reply on Jul 30, 2011 10:07 AM by Shongrunden

    Alert Alternative to pass vales to alert in mobile app

    mumcs01 Level 1

      So, I'm converting one of my Flex 4 apps to Flex 4.5 mobile, and I understand Alert shouldn't be used. I looked at Tour de Flex,a nd they have a neat way of making an Alert, but I need to pass a function name and a value which are used. depending on if the user presses 'OK', or 'CAncel'. I pass a function name because the method I'm running is used various times. My old alert was as follows.

       

      protected function unSavedAlertCheck(func:Function, current:int):void {
      if (bApply.enabled==true) {
        var o:Object = new Object();
        o["func"] = func;
        o["current"] = current;
        var alert:Alert = Alert.show("You have modified something  and are now navigating away. Doing this will not save the changes you made. Are you sure you want to navigate away and lose your changes?", "Change made without saving...", mx.controls.Alert.YES | mx.controls.Alert.NO, null, processChange);
        alert.data = o;
      } else {
        func(current);
      }
      }

       

      Any help would be great.