The image path should be the same as the “Image Name” in Maya (backslashes converted to forward).
If you exported an awd2 without checking embed images
//load awd2 no embeds
Loader3D.enableParser(AWD2Parser);
var context:AssetLoaderContext = new AssetLoaderContext(true)
AssetLibrary.load(new URLRequest("../src/YourAWD.awd"), new AWD2Parser(),context);
AssetLibrary.addEventListener(LoaderEvent.RESOURCE_COMPLETE, onResourceComplete);
AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETE, onAssetComplete);
//load awd2 no embeds swap image
Loader3D.enableParser(AWD2Parser);
var context:AssetLoaderContext = new AssetLoaderContext()
context.mapUrl("images/car_b_white_tex.jpg", "../src/images/my_other_image.jpg")
AssetLibrary.load(new URLRequest("../src/YourAWD.awd"), new AWD2Parser(),context);
AssetLibrary.addEventListener(LoaderEvent.RESOURCE_COMPLETE, onResourceComplete);
AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETE, onAssetComplete);
//AWD2 embedded into script without embeded images and swap image
var context:AssetLoaderContext = new AssetLoaderContext()
context.mapUrl("images/car_b_white_tex.jpg", "../src/my_new_image.jpg")
AssetLibrary.parseData(new AWDAsset(), new AWD2Parser(),context);
AssetLibrary.addEventListener(LoaderEvent.RESOURCE_COMPLETE, onResourceComplete);
AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETE, onAssetComplete);
If you exported an awd2 with checking embed images. (yep images will be embedded into the awd
//everything embedded into awd2 file and awd2 file embedded into script
Loader3D.enableParser(AWD2Parser);
AssetLibrary.parseData(new AWDAsset(), new AWD2Parser());
AssetLibrary.addEventListener(LoaderEvent.RESOURCE_COMPLETE, onResourceComplete);
AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETE, onAssetComplete);
But what I’ve not been able to do is. Export awd2 without embedding images. Embed that awd2 file into the script and load the images. Like you would do for awd1
eg
Loader3D.enableParser(AWD2Parser);
var context:AssetLoaderContext = new AssetLoaderContext(false, "images/")
AssetLibrary.parseData(new AWDAsset(), new AWD2Parser(),context);
AssetLibrary.addEventListener(LoaderEvent.RESOURCE_COMPLETE, onResourceComplete);
AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETE, onAssetComplete);
ps
If anybody wants to do a howto build awd sdk with Vs2010 for realy thick people. I would be very happy.