3 Replies Latest reply on Jun 22, 2010 1:41 AM by Tejas S Patel

    question regarding initial loading & busy cursor

    Tejas S Patel

      Can I change by default initial loading screen and busy cursor image/icon/component?

      I want to set another gif file inplace of default clock busy cursor.

       

      Any idea?

       

      Thank you.

        • 1. Re: question regarding initial loading & busy cursor
          aktell2007 Level 1

          Why not try the easy way - 'Search Is Rescue' Or even try the FLEX Help files ....

          • 2. Re: question regarding initial loading & busy cursor
            BhaskerChari Level 4

            Hi Tejas Patel,

             

            In order to change the initial loading of the Flex application you need to make use of the preloader property of the <mx:Application /> tage and specify the custom loader class which serves as a initial preloader of your Flex application overriding the default loader.

             

            Check out the links below , you have the source included as well:

             

            http://www.pathf.com/sites/pfd/flash/blog/08142008/srcview/index.html

            http://www.pathf.com/sites/pfd/flash/blog/08142008/PreloaderComponent.html

            http://www.pathf.com/blogs/2008/08/custom-flex-3-lightweight-preloader-with-source-code/

             

             

            For changing the busy cursor you can use the below code:

             

            Just use your animated SWF file for your custom BusyCursor in place of wait.swf

             

            <?xml version="1.0"?>
            <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

                <mx:Script>
                    <![CDATA[
                        import mx.managers.CursorManager;
                        import flash.events.*;
                       
                        // Define a variable to hold the cursor ID.
                        private var cursorID:Number = 0;
               
                        // Embed the cursor symbol.
                        [Embed(source="assets/wait.swf")]
                        private var waitCursorSymbol:Class;
                               
                        // Define event listener to display the wait cursor
                        // and to load the image.
                        private function initImage(event:MouseEvent):void {
                            // Set busy cursor.
                            cursorID = CursorManager.setCursor(waitCursorSymbol);
                            // Load large image.
                            image1.load("../assets/DSC00034.JPG");
                        }

                        // Define an event listener to remove the wait cursor.
                        private function loadComplete(event:Event):void {
                            CursorManager.removeCursor(cursorID);  
                        }              
                    ]]>
                </mx:Script>

                <mx:VBox>
                    <!-- Image control to load the image. -->
                    <mx:Image id="image1"
                        height="50"
                        width="100"
                        scaleContent="true"
                        complete="loadComplete(event);"/>

                    <!-- Button triggers the load. -->
                    <mx:Button id="myButton" label="Show" click="initImage(event);"/>
                </mx:VBox>
            </mx:Application>


            If this post answers your question or helps, please kindly mark it as such.


            Thanks,

            Bhasker Chari

            1 person found this helpful
            • 3. Re: question regarding initial loading & busy cursor
              Tejas S Patel Level 1

              Thank you bhasker.

              its so much helpful for me.