# Passing variables between SWF files

**URL:** <https://forum.kirupa.com/t/passing-variables-between-swf-files/288846>\
**Category:** flash\
**Created:** [May 21, 2009, 7:03pm UTC](https://forum.kirupa.com/t/passing-variables-between-swf-files/288846 "2009-05-21T19:03:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tvandenburg](https://avatars.discourse-cdn.com/v4/letter/t/22d042/32.png) [@tvandenburg](https://forum.kirupa.com/u/tvandenburg)\
**Post date:** [May 21, 2009, 7:03pm UTC](https://forum.kirupa.com/t/passing-variables-between-swf-files/288846/1 "2009-05-21T19:03:19Z")

</div>

I apologize if this has been asked and answered a thousand times, but I’ve spent the better part of an hour searching and haven’t found my answer, so here I am 😉

I have a flash file that I made that displays a scrolling newsfeed (I’ll call it newsfeed.swf)… I published it to an SWF. Now, I created a new flash file that I would like to use to show many instances of newsfeed.swf. In my new flash file, I have the following code:

this.onLoad=function(){  
mcNewsfeed.loadMovie([http://www.whatever.com/newsfeed.swf?s=MSFT](http://www.whatever.com/newsfeed.swf?s=MSFT));  
}

In theory, when newsfeed.swf starts up, the ?s=MSFT variable should be passed in at the \_root level such that I should be able to reference it and build the newsfeed to be displayed dynamically. I’ve tried several different things, but no matter what I do, the following code (the \_root.s part) in newsfeed.swf returns “undefined”:

newsfeedURL = “[http://finance.yahoo.com/rss/headline?s=](http://finance.yahoo.com/rss/headline?s=)” + \_root.s

I would prefer to not have to pass XML files between the swf files or use system objects as that would add a level of complexity I’m not ready to deal with (I’m a total noob at this stuff)…

Can anyone help me get the two swf files to talk to each other nicely??

Thanks!:sen:
