# Passing variables from the page

**URL:** <https://forum.kirupa.com/t/passing-variables-from-the-page/310175>\
**Category:** flash\
**Created:** [June 3, 2010, 11:43am UTC](https://forum.kirupa.com/t/passing-variables-from-the-page/310175 "2010-06-03T11:43:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![theMonitor](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@theMonitor](https://forum.kirupa.com/u/theMonitor)\
**Post date:** [June 3, 2010, 11:43am UTC](https://forum.kirupa.com/t/passing-variables-from-the-page/310175/1 "2010-06-03T11:43:00Z")

</div>

I’ve been writing movies in AS2 that have variables passed to them via the src parameter of the page code, e.g.

src="/Flash/theMovie.swf?value=1"

then in the AS I don’t need to define ‘val’, I can use it straight away.

However, in AS3 - at least, as I understand it - it seems that I can’t drop ‘val’ into the code without defining it, as it throws "“1120: Access of undefined property val”. So, if I add a line of code

public var val:Number;

…or somesuch, will this be enough to ensure ‘val’ is useable once it comes through from the page?

Apologies for the unresearched nature of this query; not something I usually like to do, but one or two other things are more pressing

Thanks in advance to anyone who can help.
