# Casting vs As?

**URL:** <https://forum.kirupa.com/t/casting-vs-as/289648>\
**Category:** flash\
**Created:** [June 2, 2009, 10:17pm UTC](https://forum.kirupa.com/t/casting-vs-as/289648 "2009-06-02T22:17:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![grandpaw\_broon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/grandpaw_broon/32/3985_2.png) [@grandpaw\_broon](https://forum.kirupa.com/u/grandpaw_broon)\
**Post date:** [June 2, 2009, 10:17pm UTC](https://forum.kirupa.com/t/casting-vs-as/289648/1 "2009-06-02T22:17:50Z")

</div>

Hey all.

I have noticed that in AS3, lets say i have a text field which uses a int variable.

var myNumber:int = 10394;

…  
textField.text = String(myNumber);

or

…  
textField.text = myNumber as String;

I have to say that i use a mixture of these as i find the need for this situation all the time.

In the past i have noticed that as does not work in some rare cases. I tend to think of these as exactly the same thing but clearly there is a difference.

Can anyone share the specifics?

Cheers.
