Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6952853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:24:11+00:00 2026-05-27T14:24:11+00:00

I’m building an app with Flex 4.6 and AIR. It will be published on

  • 0

I’m building an app with Flex 4.6 and AIR. It will be published on Android and iPhone but for now I’m testing on an Android device.

I’ve got the basic flow working with different screens and even a flash component.

However, when switching between screens, all of my s:Image objects take a long time to load, even when deployed to an actual device. By long time I only mean about a half a second. This normally wouldn’t be so bad, but the text on the screen shows up immediately, while all of the images remain white for half a second and then they load.

Is this just an AIR/Flex thing? Has anyone else run in to this, hopefully with a solution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:24:11+00:00Added an answer on May 27, 2026 at 2:24 pm

    Images tend to load quicker if you embed them in the Flex App. More info on that here. The code behind this would look like this:

    [Embed(source="logo.gif")] 
    [Bindable] 
    public var imgCls:Class;
    

    Then you can use that class like this:

     <s:Image id="myImageRaw" source="{imgCls}"/>
    

    [code copied from docs]

    If you need to use the same image multiple times, you should look into using the BitMapImage class; and cloning the bitMapData of the first image. Here is a quick utility class I “Borrowed and modified” for getting the BitMapData from a sprite, and vice versa. [The Flex Image class class extends sprite, so you should be able to send an image in as the input]

    package com.natejc.utils.display
    {
        import flash.display.Bitmap;
        import flash.display.BitmapData;
        import flash.display.DisplayObject;
        import flash.display.Sprite;
    
    
        // **********************************************************************************
        // **********************************************************************************
        // borrowed from http://www.natejc.com/source/com/natejc/utils/display/DisplayConverter.as
    
        /**
         * Provides convenience conversion methods for Sprites and Bitmaps.
         * 
         * Open source. Free to use. Licensed under the MIT License.
         * 
         * @author  Nate Chatellier
         * @see     http://blog.natejc.com
         */
        public class DisplayConverter
        {
    
    
            // **********************************************************************************
    
    
            /**
             * Constructs the DisplayConverter object.
             */
            public function DisplayConverter()
            {
                trace("DisplayConverter is a static class and should not be instantiated");
    
            } // END CONSTRUCTOR
    
    
    
            // **********************************************************************************
    
    
            /**
             * Converts a Bitmap to a Sprite.
             *
             * @param   bitmap      The Bitmap that should be converted.
             * @param   smoothing   Whether or not the bitmap is smoothed when scaled.
             * @return              The converted Sprite object.
             * 
             * @see                 http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Bitmap.html#smoothing
             */
            public static function bitmapToSprite(bitmap:Bitmap, smoothing:Boolean = false):Sprite
            {
                var sprite:Sprite = new Sprite();
                sprite.addChild( new Bitmap(bitmap.bitmapData.clone(), "auto", smoothing) );
                return sprite;
    
            } // END FUNCTION bitmapToSprite
    
    
            // **********************************************************************************
    
    
            /**
             * Converts a Sprite to a Bitmap.
             *
             * @param   sprite      The Sprite that should be converted.
             * @param   smoothing   Whether or not the bitmap is smoothed when scaled.
             * @return              The converted Bitmap object.
             * 
             * @see                 http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/BitmapData.html#draw()
             */
            public static function spriteToBitmap(sprite:Sprite, smoothing:Boolean = false):Bitmap
            {
                var bitmapData:BitmapData = new BitmapData(sprite.width, sprite.height, true, 0x00FFFFFF);
                bitmapData.draw(sprite);
    
                return new Bitmap(bitmapData, "auto", smoothing);
    
            } // END FUNCTION spriteToBitmap
    
    
    
            /**
             * JH DotComIT added 11/19/2011
             * Converts a Sprite to a BitmapData.
             *
             * @param   sprite      The Sprite that should be converted.
             * @return              The converted Bitmap object.
             * 
             * @see                 http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/BitmapData.html#draw()
             */
            public static function spriteToBitmapData(sprite:Sprite):BitmapData
            {
                var bitmapData:BitmapData = new BitmapData(sprite.width, sprite.height, true, 0x00FFFFFF);
                bitmapData.draw(sprite);
    
                return bitmapData;
    
            } // END FUNCTION spriteToBitmapData
    
            /**
             * Converts BitmapData to a Sprite.
             *
             * @param   bitmap      The Bitmap that should be converted.
             * @param   smoothing   Whether or not the bitmap is smoothed when scaled.
             * @return              The converted Sprite object.
             * 
             * @see                 http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Bitmap.html#smoothing
             */
            public static function bitmapDataToSprite(bitmapData:BitmapData, smoothing:Boolean = false):Sprite
            {
                var sprite:Sprite = new Sprite();
                sprite.addChild( new Bitmap(bitmapData.clone(), "auto", smoothing) );
                return sprite;
    
            } // END FUNCTION bitmapToSprite
    
    
            // **********************************************************************************
            // **********************************************************************************
    
    
        } // END CLASS DisplayConverter
    } // END PACKAGE
    

    Once you have the BitMapData you can call clone to get a copy of it and create multiple instances of the same image. [Do some research into blitting; a technique used by game developers]. The Spark Image tag will also accept BitMapData as the source.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.