# CS3 AS2 level undefined

**URL:** https://forum.kirupa.com/t/cs3-as2-level-undefined/277657
**Category:** flash
**Created:** [December 15, 2008, 2:41pm UTC](https://forum.kirupa.com/t/cs3-as2-level-undefined/277657 "2008-12-15T14:41:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![clairenw](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@clairenw](https://forum.kirupa.com/u/clairenw)
#### Post date: [December 15, 2008, 2:41pm UTC](https://forum.kirupa.com/t/cs3-as2-level-undefined/277657/1 "2008-12-15T14:41:13Z")

</div>

Hi

I’m having problems with this code - it’s to show a reference popup when you mouseover a button:

function showRef(o:Object, s:String) {  
var str: String = “’”+o+"’";  
var arr: Array;  
arr = str.split("_");  
str = "ref_"+arr[2];  
str = str.substr(0, str.length-1);  
var obj: Object = this[str];  
this[str].\_visible = true;  
trace (this[str]);  
if (s == “chart”) {  
if (!graphBig){  
obj.\_x = 30;  
obj.\_y = 275;  
} else {  
obj.\_x = 200;  
obj.\_y = 290;  
}  
}  
}

It works fine when I publish it as a standalone swf - the ref popup shows and repositions fine (I get a trace saying something like this: “\_level0.ref\_X”). But the swf is being called into a framework, and that’s when I get a problem as the trace then shows “undefined”.

Be gentle with me, I’m pretty new to all this. 🙂
