# Variable Madness!

**URL:** https://forum.kirupa.com/t/variable-madness/223902
**Category:** flash
**Created:** [April 26, 2007, 4:01pm UTC](https://forum.kirupa.com/t/variable-madness/223902 "2007-04-26T16:01:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![MiddleFingerMan](https://avatars.discourse-cdn.com/v4/letter/m/bbce88/32.png) [@MiddleFingerMan](https://forum.kirupa.com/u/MiddleFingerMan)
#### Post date: [April 26, 2007, 4:01pm UTC](https://forum.kirupa.com/t/variable-madness/223902/1 "2007-04-26T16:01:37Z")

</div>

I’m not too sure what I’m doing wrong here but I’ve been stuck on this for too long now…

I’ve got a full browser Flash project that has the container that then pulls in a some background images (located in one swf), a logo, a menu and then some content boxes (10 boxes in one swf).

My menu swf has button code in it to set off a few things on rollOver, rollOut and onPress. Here’s a look at one of the onPress functions:

[AS]menu.btn\_contact.onPress = function () {  
myActiveButton = “contact”;  
enableButtons (myActiveButton);  
new Tween(currentPhoto, “\_alpha”, Strong.easeIn, 100, 0, 1, true);  
new Tween(\_root.obj\_photos.photo006, “\_alpha”, Strong.easeIn, 0, 100, 1, true);  
new Tween(currentContent, “\_x”, Strong.easeOut, 0, 1024, 2, true);  
new Tween(\_root.obj\_content.mcContent010, “\_x”, Strong.easeOut, 1024, 0, 2, true);  
currentPhoto = \_root.obj\_photos.photo006;  
trace(currentContent);  
currentContent = “\_root.obj\_content.mcContent010”;  
trace(currentContent);  
}[/AS]

Now I declare the variables earlier in the script like so:

[AS]currentPhoto = \_root.obj\_photos.photo001;  
currentContent = “\_root.obj\_content.mcContent001”;[/AS]

Odd thing is, the currentPhoto variable works just fine without the quotes, the currentContent does not. If I leave that one with out the quotes and trace the variable, it comes up undefined.

The trace functions show currentContent’s value as \_root.obj\_content.mcContent001 the first time then \_root.obj\_content.mcContent010 which tells me its working but it does not trigger the tween! If I dump \_root.obj\_content.mcContent001 in there as opposed to currentContent it works just fine but as soon as I place the variable in there, it croaks.

I’m losing it here… any ideas?

Thanks in advance!
