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 230237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:49:57+00:00 2026-05-11T19:49:57+00:00

I am in the process of creating a new – lite – version of

  • 0

I am in the process of creating a new – “lite” – version of a Flex application I created a while ago. I have been porting over many of the Classes and Components to a Flex Library Project that compiles an SWC file. Because both are Cairngorm applications, I’m not able to completely eradicate duplicate code, but it seems logical that I should be able to share assets – such as icons (PNG files). What is the best way to do this? I have tried including them in the SWC, but I can’t figure out how to access them in the application. If you can help me figure that out, then my question will be answered. Any thoughts?

Here is and example of how I currently embed icons/images in my Flex application:

<mx:Script>
    <![CDATA[
        [Bindable]
        [Embed(source="assets/icons/cancelIcon.png")]
        private var cancelIcon:Class;

        [Bindable]
        [Embed(source="assets/icons/saveIcon.png")]
        private var saveIcon:Class;
    ]]>
</mx:Script>

Thanks.

  • 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-11T19:49:57+00:00Added an answer on May 11, 2026 at 7:49 pm

    0) First, looking at the code above – I recommend some minor changes:

    // Actionscript instead of MXML:
    public class ResourceClasses
    {
            Bindable]
            [Embed(source="assets/icons/cancelIcon.png")]
            public static var CancelIconClass:Class;
    
            // make your variable public and static without public no one 
            // outside the class can access AND bindable won't matter
    }
    

    —- Now, compile your library.
    —- If the assets aren’t in the right place the compiler will complain

    1) In your application, you need to reference the library project / swc

    —- You should be able to get code hints / intellisense in Flex Builder / eclipse from classes in your Application to classes in the library project

    2) In your Application – Do some code like this:

    var image:Image = new Image();
    image.source = ResourceClasses.CancelIconClass;
    
    // more image property setting... 
    
    someCanvas.addChild(image);
    

    3) This will get you going – using a Library project to hold images, etc…

    *** DO NOTE: If the images need to be loaded multiple times, reused, etc — There are other steps to take to squeeze out the best performance, etc…

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

Sidebar

Related Questions

I'm currently in a process of creating a new C project and I have
I have successfully automated the process of creating a new IIS website, however the
We are new to ROR, We have issue in creating Login/Logout process in ROR
I'm creating new processes using System.Diagnostics.Process class from my application. I want this processes
I am in the process of creating a new skin for an application written
I am in process of creating a new universal application. Would it be bad
I am in the process of creating a new team project by executing the
I am currently in the process of creating a new news/publishing site on the
The process of creating a new build and releasing it to production is a
Our process for creating a new development (get latest, setup db, setup IIS directories

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.