# Swfobject variable

**URL:** <https://forum.kirupa.com/t/swfobject-variable/297578>\
**Category:** Uncategorized\
**Created:** [October 5, 2009, 4:22pm UTC](https://forum.kirupa.com/t/swfobject-variable/297578 "2009-10-05T16:22:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![autumnmedia](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@autumnmedia](https://forum.kirupa.com/u/autumnmedia)\
**Post date:** [October 5, 2009, 4:22pm UTC](https://forum.kirupa.com/t/swfobject-variable/297578/1 "2009-10-05T16:22:48Z")

</div>

hi i am passing a variable into an swf using the addVariable seen below

```auto

    <script type="text/javascript">
        // <![CDATA[
        
        var so = new SWFObject("ticker.swf", "background", "293", "107", "8", "#000000");
        so.addParam("menu", "false");
        so.addParam("wmode", "transparent");
        so.addVariable("percentage", "50");
        so.write("flashcontent");
        
        // ]]>
    </script>    

```

my action script is

```auto

import fl.transitions.*;
import fl.transitions.easing.*;

var Trotation:uint;
var percentage;

if(percentage != "" && percentage != null){
Trotation = percentage;
}

tracer.text = String(percentage);

var myTweenRotation:Tween = new Tween(ticker, "rotation", Strong.easeOut, 0, Trotation, 3, true);
var myTweenRotation2:Tween = new Tween(tickMask, "rotation", Strong.easeOut, 0, Trotation, 3.2, true);

```

i continually get undefined when i view the html page, any help would be great thanks
