# Calling JavaScript to Return a Number - Problem?

**URL:** <https://forum.kirupa.com/t/calling-javascript-to-return-a-number-problem/211720>\
**Category:** flash\
**Created:** [January 4, 2007, 3:51pm UTC](https://forum.kirupa.com/t/calling-javascript-to-return-a-number-problem/211720 "2007-01-04T15:51:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dewey](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@dewey](https://forum.kirupa.com/u/dewey)\
**Post date:** [January 4, 2007, 3:51pm UTC](https://forum.kirupa.com/t/calling-javascript-to-return-a-number-problem/211720/1 "2007-01-04T15:51:26Z")

</div>

\*\*EDIT: \*\*I got it figured out… it was casting… never knew I could cast so easily!!!

Thanks anyways!

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=–=-=-=-=-=-=-=-=-=-

Hey everyone… I have this code in my application…

```auto
var returned:Number = ExternalInterface.call("returnEntryCount");
nInterval = setInterval(upTo, 1000, returned);

```

“returned” is simply a number (integer to be precise)… but when I run my app I get this error:

```auto
Type mismatch in assignment statement: found Object where Number is required.

```

It looks to be some sort of casting problem, but I can’t understand why this won’t work… can anyone give me some advice here?

Thanks,

–d
