Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

accessing variables

Status
Not open for further replies.

0gani

Technical User
Oct 9, 2006
14
SK
how do I access a variable that was created in a function? For example


<code>
function create()
{
var myvariable:string='hello world';
}
trace myvariable
</code>





does anyone have a solution for this?
 
function create()
{
var myvariable:string='hello world';
}
create()
trace(myvariable)

will give undefined if you use var within a function then the variable is local to the function and only available within the function to trace it outside the function drop the var
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top