# Get Easing Function Name From XML

**URL:** <https://forum.kirupa.com/t/get-easing-function-name-from-xml/299516>\
**Category:** flash\
**Created:** [November 6, 2009, 2:35am UTC](https://forum.kirupa.com/t/get-easing-function-name-from-xml/299516 "2009-11-06T02:35:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigbstanley](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@bigbstanley](https://forum.kirupa.com/u/bigbstanley)\
**Post date:** [November 6, 2009, 2:35am UTC](https://forum.kirupa.com/t/get-easing-function-name-from-xml/299516/1 "2009-11-06T02:35:24Z")

</div>

So I’ve researched this and I’ve found a few posts, nothing seems to work. I have an xml sheet that has a number of values - one of them contains the type of easing that I would like to apply to a movie clip.

```auto

<settings loop="false">
<section duration="5">
<image startX="-120" endX="0" startY="-80" endY="0" startAlpha="100" endAlpha="100" duration="6" easing="Elastic.easeOut" delay="0" startScale="90" endScale="100">images/9_properties_l.jpg</image>
</section>
</settings>

```

The problem is, is that when I parse the xml in actionscript, I get the correct value of the easing attribute, but it is storing it either as a string, or some kind of weird function name.

Here is the AS I am using:  
[AS]  
xmlNode = this.firstChild;  
totalSlides = xmlNode.childNodes.length;

for (z=0; z \< totalSlides; z++) {  
var obj:Object = new Object();  
obj.dur = xmlNode.childNodes[z].attributes.duration \* 1000;  
slides.push(obj);

```
  var image:Object = new Object();
  var imageNode = xmlNode.childNodes[z].childNodes[0];
  image.img = imageNode.childNodes;
  image.startX = imageNode.attributes.startX;
  image.endX = imageNode.attributes.endX;
  image.startY = imageNode.attributes.startY;
  image.endY = imageNode.attributes.endY;
  image.startAlpha = imageNode.attributes.startAlpha;
  image.endAlpha = imageNode.attributes.endAlpha;
  image._duration = imageNode.attributes.duration;
  image._easing = imageNode.attributes.easing];
  image._delay = imageNode.attributes.delay;
  image.startScale = imageNode.attributes.startScale;
  image.endScale = imageNode.attributes.endScale;
        
       //don't want to do this, but it's the only that makes it work
       switch(image._easing){
            case "Elastic.easeOut":
                image._easing = Elastic.easeOut;                         
        }
    imgSlides.push(image);

```

}

//later, I apply the variables to a function like this:  
TweenLite.to(imgMC, img\_dur, {ease:imgSlides[0].\_easing });

[/AS]

I’ve tried type casting as “function” as well and it doesn’t seem to be working. Any ideas?
