# Problem loading varibales into swf

**URL:** <https://forum.kirupa.com/t/problem-loading-varibales-into-swf/224689>\
**Category:** Uncategorized\
**Created:** [May 4, 2007, 1:37pm UTC](https://forum.kirupa.com/t/problem-loading-varibales-into-swf/224689 "2007-05-04T13:37:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![strawberry](https://avatars.discourse-cdn.com/v4/letter/s/f19dbf/32.png) [@strawberry](https://forum.kirupa.com/u/strawberry)\
**Post date:** [May 4, 2007, 1:37pm UTC](https://forum.kirupa.com/t/problem-loading-varibales-into-swf/224689/1 "2007-05-04T13:37:57Z")

</div>

[SIZE=2]Hi guys[/SIZE]  
[SIZE=2]I need help loading a variable into an swf poll…[/SIZE]  
[SIZE=2]this is the code that should load the info coming from the db after the user voted…[/SIZE]  
[SIZE=2]but I keep getting an output error message[/SIZE]  
[SIZE=2]tha actionscript code is this[/SIZE]

```auto
1 //How many votes in total?
2 var totalVotes:Number = Number(loadVars_in.totalVotes);
3 var end:Number;
4 for(i=1;i<=4;i++){
5 vote = loadVars_in["vote" + i + "total"]
6 procent = Math.round(( vote / totalVotes) * 100);
7 if(votes==1){
8 end = "Vote";
9 } else {
10 end = "Votes";
11 }
12 _root["graph"+i+"_mc"].bar_mc._xscale = procent;
13 _root["graph"+i+"_mc"].procent.text = procent + " % - " + vote + end;
14 
15 }

```

The output error message is this:  
**Error** Scene=Scene 1, layer=Layer 1, frame=10: **Line 8** :  
Type mismatch in assignment statement: found String where Number is required.  
**end = “Vote”;**  
**Error** Scene=Scene 1, layer=Layer 1, frame=10: **Line 10** :  
Type mismatch in assignment statement: found String where Number is required.  
**end = “Votes”;**  
Total ActionScript Errors: 2 Reported Errors: 2

please can you explain me?  
thank you
