How to create ngui Atlas in runtime??

How to create ngui Atlas in runtime? My code is as below and “background” is prefab name.
I thought after first Atlas will be created.Actually the result of background.atlas was null.
No idea to do.Please.I m a new into unity.

   background.atlas = (UIAtlas)Resources.Load("background");
   Debug.Log(background.atlas);

Not yet :frowning:
Then, I decided to stop work on NGUI as lack information.

Atlas of NGUI is a prefab in the project view. You can add this prefab to the game scene, then in you script, use a public variable to let yourself drag and drop this gameobject. Sample script:

public class AtlasNeedClass
{
public UIAtlas atlas;

private UISprite spriteToChangeAtlasAtRuntime;

void Update()
{
    spriteToChangeAtlasAtRuntime.atlas = atlas;
}

}

P.S. Maybe the answer is too late. My purpose is for those guys coming for a solution, since I found this post when I had this question.