# CS5 and AS3

**URL:** https://forum.kirupa.com/t/cs5-and-as3/313525
**Category:** flash
**Created:** [September 1, 2010, 10:23pm UTC](https://forum.kirupa.com/t/cs5-and-as3/313525 "2010-09-01T22:23:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![poeticparadox](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@poeticparadox](https://forum.kirupa.com/u/poeticparadox)
#### Post date: [September 1, 2010, 10:23pm UTC](https://forum.kirupa.com/t/cs5-and-as3/313525/1 "2010-09-01T22:23:58Z")

</div>

I am now working in Flash CS5 and I some how seem to have lost the plot with AS. The interaction is something foreign and the simple things are lost on my for some reason.

The simple point I am trying to make is I need to create a var and pass it through to a function:

var refer:String =“[http://alison.studiosgroup.co.uk](http://alison.studiosgroup.co.uk)”;

About\_Com\_btn.addEventListener(MouseEvent.CLICK, fl\_MouseClickHandler);

function fl\_MouseClickHandler(event:MouseEvent):void  
{  
// Start your custom code  
var targetURL:URLRequest = new URLRequest(refer.toString("/buying.htm"));  
navigateToURL(targetURL, “mainFrame”);  
// This example code displays the words “Mouse clicked” in the Output panel.  
trace(“Mouse clicked”);  
// End your custom code  
}

Simple I would expect, but no. I would like to declare the “var refer” to pass to the second var targetURL. This is so that I can pass a test domain to the function and then once testing is complete I would like to change the “var refer” to the new domain.

Am I lost or just looking at the trees in the forest I can’t see ☹
