Skip to content
July 23, 2008 / Shrikant Patil

Centralising Embedded Images of Application

Centralizing embedded image include creating a public class where all images required by the application are get embedded and declared as public static constants, which are get accessed any where within whole application, by importing the centralized embedded images class.

Say that we have three images which are going to be used in a application, classes and components, then create centralized embedded images class as follows;

package com
	public class AssetImages
			public static const WAITING_ICON:Class;
			public static const BUSY_ICON:Class;
			public static const IDLE_ICON:Class;

that’s pretty, Let you now access any of these embedded images by their constant reference in anywhere within your application, like as follows;

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx=""
		import com.AssetImages;
		private function assignIcon():void{
	<mx:Button id="myButton"

This provides a centralized place for all embedded image of an application, so that any changes, updates are done in one place will get updated in overall application.


One Comment

Leave a Comment
  1. iaadamwilliamst4 / Sep 16 2011 2:05 am

    Hello guys & gals, I’m Ben jamin!

    I’m new to the forum and just saying hello.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: