# Actionscript optimization with AS3 - two questions

**URL:** <https://forum.kirupa.com/t/actionscript-optimization-with-as3-two-questions/272536>\
**Category:** flash\
**Created:** [October 6, 2008, 8:09am UTC](https://forum.kirupa.com/t/actionscript-optimization-with-as3-two-questions/272536 "2008-10-06T08:09:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![IanCremona](https://avatars.discourse-cdn.com/v4/letter/i/65b543/32.png) [@IanCremona](https://forum.kirupa.com/u/IanCremona)\
**Post date:** [October 6, 2008, 8:09am UTC](https://forum.kirupa.com/t/actionscript-optimization-with-as3-two-questions/272536/1 "2008-10-06T08:09:55Z")

</div>

I am using a a AS3 slider (a great script which can be found at [http://www.blog.noponies.com/archives/51](http://www.blog.noponies.com/archives/51)) to load a number of SWF files, which in turn, each load text from the smae XML file:

```auto
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, showXML);
xmlLoader.load(new URLRequest("slideimages.xml"));
function showXML(e:Event):void {
    XML.ignoreWhitespace = true;
    var promotion:XML = new XML(e.target.data);
    this.line1.line1.text = promotion.slide[0].line1.text()
    this.line2.line2.text = promotion.slide[0].line2.text()
    this.playfree.playfree.playfree.text = promotion.slide[0].playfree.text()

}

```

The problem is that the banner (which is located at [http://spicytest.com/banner/](http://spicytest.com/banner/)) takes way too many resources. about 110mb ram when running in firefox and quite a lot of processing power.

My 2 questions:

1. Is there a way to load the XML file in the main slider instead on each and every slide? and will that optimize the banner at all

2. the banner must support 7 languages, is there a friendly way of setting the character glyphs (ie. create one textfield that loads all the glyphs and run different instances of it?)? I noticed that the file size increases quite a lot when I add the glyphs on each and every text field (which are not runtime)

Thanks,  
Ian
