Click here to Skip to main content
15,920,603 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, For the below code i want add busy cursor in loadvalues function. So i added like busy cursor as show in below code. but its not working. So tell me what the problem. i'm new to this flex so pls help me in this.........


C#
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
    creationComplete="loadValues()" horizontalAlign="center"
    verticalAlign="middle"  color="#080808" borderColor="#FFF8E0" backgroundColor="#FFF8E0"
    xmlns:local="*"
    xmlns:tInput="assets.actionScript.*"
    xmlns:controls="com.iwobanas.controls.*"
    initialize="initTimer()"
    xmlns:dataGridClasses="com.iwobanas.controls.dataGridClasses.*"
    applicationComplete="init(event)" height="100%" width="100%">

<mx:Style source="defaults.css" />

<mx:Script>
    <![CDATA[
        import assets.actionScript.Trim;
        import com.scottlogic.charts.DataGridExporter;
        import mx.controls.ComboBase;
        import assets.script.pods.view.Data;
        import org.alivepdf.layout.Unit;
        import mx.collections.ICollectionView;
        import assets.actionScript.EscalationDTO;
        import alarmSlide.TowerSelection;

        import flash.net.navigateToURL;
        import mx.binding.utils.BindingUtils;
        import mx.controls.dataGridClasses.DataGridItemRenderer;
        import mx.events.ListEvent;
        import mx.charts.chartClasses.DualStyleObject;
        import assets.actionScript.TowerInchargeRoleMappingDTO;
        import flash.utils.clearInterval;
        import flash.utils.setInterval;
        import alarmSlide.SendMessageForEscalation;
        import mx.skins.halo.BusyCursor;
        import alarmSlide.REForAlarmReport;
        import flash.events.*;

        import mx.managers.ToolTipManager;
        import mx.controls.ToolTip;
        import mx.collections.SortField;
        import mx.collections.Sort;
        import mx.messaging.messages.RemotingMessage;
        import mx.events.AdvancedDataGridEvent;
        import assets.actionScript.TowerStatus;
        import mx.rpc.events.FaultEvent;
        import mx.rpc.events.ResultEvent;
        import assets.actionScript.ValueObject;
        import mx.messaging.channels.AMFChannel;
        import alarmSlide.LEDChar;
        import mx.utils.URLUtil;
        import com.adobe.serialization.json.JSON;
        import com.adobe.serialization.json.JSONDecoder;
        import mx.collections.ArrayCollection;
        import mx.collections.IViewCursor;
        import mx.collections.IHierarchicalCollectionView;
        import mx.controls.Alert;
        import mx.managers.PopUpManager;
        import flash.net.FileReference;
        import mx.messaging.messages.IMessage;
        import mx.messaging.Channel;
        import mx.messaging.ChannelSet;
        import mx.messaging.channels.StreamingAMFChannel;
        import flash.display.StageDisplayState;
        import mx.collections.ArrayCollection;
        import mx.managers.CursorManager;

        private var sendMessageScreen:SendMessageForEscalation;
        private var escalationAlarmHistoryPopup:EscalationAlarmHistoryPopup;
        public var manualOrScheduleTicketing:ManualOrScheduleTicketing;
        public var editEscalationLevelPopup:EditEscalationLevelPopup;
        private var escalationLevelPopup:EscalationLevelPopup;
        private var escalationSiteDetailsPopup:EscalationSiteDetailsPopup;

        [Bindable] private var towerName:String = "NoData";
        [Bindable] private var contactNumber:String = "NoData";

        // Data Storgae variables
        [Bindable] private var energyConsumption:ArrayCollection = new ArrayCollection();
        [Bindable] public var dataColl:ArrayCollection = new ArrayCollection();
        [Bindable] public var closedTicketArrayColl:ArrayCollection = new ArrayCollection();
        [Bindable] private var towerDetails:ArrayCollection = new ArrayCollection();
        [Bindable] private var escalationData:ArrayCollection = new ArrayCollection();
        [Bindable] public var escalationLevelDetails:ArrayCollection = new ArrayCollection();
        [Bindable] public var towerEscalationLevelDetails:ArrayCollection = new ArrayCollection();
        [Bindable] private var escalationMasterList:ArrayCollection = new ArrayCollection();
        [Bindable] public var alarmDetailsList:ArrayCollection = new ArrayCollection();

        [Bindable] public var siteInformationList:ArrayCollection;
        [Bindable] public var communicationInfoList:ArrayCollection;
        [Bindable] public var operatorDetailsList:ArrayCollection;
        [Bindable] public var siteLiveDataList:ArrayCollection;
        [Bindable] public var siteLiveAlarmDetailsList:ArrayCollection;
        [Bindable] public var ticketEscalationStateList:ArrayCollection = new ArrayCollection();
        [Bindable]
        public var siteAndDistrictDisplayName:String="";
        public var categoriesArrColl:ArrayCollection = null;
        public var tempArrColl:ArrayCollection = null;
        public var userID:int = 0;
        public var customertId:int = 3;
        private var popupWin:PopupForTicketing;
        // to store tower configuration
        public static var data:ArrayCollection = new ArrayCollection();

        private var intervalUnit:uint;

        [Bindable]
        public var folderList:XMLList;
        // BlazeDS variables
       [Bindable] public var channelUrl:String;

        [Bindable] public var liveId:int=0;

        [Bindable]
        public var emailOrSmsMessageFormat:String = "";

        [Bindable]
        private var escalationEditOption:Boolean = false;

        [Bindable]
        private var swapCount:int = 0;

//  ---------------------------- To Control Session ------------------------- //
        public var myTimer:Timer;

        private function initTimer():void
        {
             myTimer = new Timer(1800000);
             myTimer.addEventListener("timer",logout);
             this.addEventListener(MouseEvent.MOUSE_MOVE, resetTimer);
             myTimer.start();
        }

        private function logout(event:Event):void
        {
            this.addEventListener(MouseEvent.CLICK,forward);
        }

        private function forward(event:Event):void
        {
            navigateToURL( new URLRequest("jsp/checkin/index.jsp"),"_self");
        }

        private function resetTimer(event:Event):void
        {
            myTimer.reset();
            initTimer();
        }
//  ---------------------------- To Control Session ------------------------- //
//***************************************************************************************************************************************//
            /**
            * This method will be called as soon as SWF loads in the browser , creating a AMF channel which communicates to Java
            **/
            private function loadValues():void{

                ticketViewStack.selectedChild = liveTicketVBox;
                    /*userID = Application.application.parameters.userId;
                customertId = Application.application.parameters.customerId;
                if("true" == Application.application.parameters.escalationEditOption.toString()){
                    escalationEditOption = true;
                }
                channelUrl = "./messagebroker/amf";
            */

                userID = 92;
                customertId = 3;
                escalationEditOption = true;
                channelUrl = "http://localhost:8080/Telecom/messagebroker/amf";

                var cs:ChannelSet = new ChannelSet();
                var customChannel:AMFChannel = new AMFChannel("my-amf",channelUrl);
                cs.addChannel(customChannel);
                remoteObject.channelSet = cs;
                remoteObject.getEscalationMaster();
                //Alert.show("its loading......");

                //Alert.show("its loading...133434...");
                cursorManager.setBusyCursor();
                remoteObject.getAllLiveEscalationDetails(userID,customertId,displayTower.selectedItem.data,ticketType.selectedItem.data);
                cursorManager.removeBusyCursor();
                displayTower.selectedIndex = 0;
                refereshTime.selectedIndex = 0;

            }

//***************************************************************************************************************************************//
            public var selectedTicketState:Number= 0;
            // Handle the recevied message.
            private function resultHandler(event:ResultEvent):void {
                var message:RemotingMessage = event.token.message as RemotingMessage;
                switch(message.operation)
                {
                    case "getAllLiveEscalationDetails":
                            dataColl = new ArrayCollection();
                            dataColl = event.result as ArrayCollection;
                            break;

************************************************************************************


i added busy cursor in loadvalues() function.
Posted
Updated 2-Feb-12 23:19pm
v2
Comments
Rajesh Anuhya 3-Feb-12 5:19am    
Edited: Code Tags added.
--RA

1 solution

...but you are never calling that function loadvalues()...

The Busy Indicator (That's what this is called in general) can be used by simply Flex-Coding it: Display the busy indicator for long-running activity in a mobile application[^] @ adobe.com help
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900