# Calling function on a yet to be loaded .swf

**URL:** <https://forum.kirupa.com/t/calling-function-on-a-yet-to-be-loaded-swf/307584>\
**Category:** flash\
**Created:** [April 6, 2010, 11:18am UTC](https://forum.kirupa.com/t/calling-function-on-a-yet-to-be-loaded-swf/307584 "2010-04-06T11:18:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anthony\_z](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@anthony\_z](https://forum.kirupa.com/u/anthony_z)\
**Post date:** [April 6, 2010, 11:18am UTC](https://forum.kirupa.com/t/calling-function-on-a-yet-to-be-loaded-swf/307584/1 "2010-04-06T11:18:36Z")

</div>

Hey everyone,

I am a designer so my programming skills are very limited. I have an issue that I’m losing my patients over, so I need your help. I went through a bunch of tutorials, none of them seemed to apply.  
I have put together a sample (“sample\_site”), if you would check it out, I would appreciate it.  
You might ask, why did I use this many UILoaders, it is because on the original site I use a third party component, which doesn’t work well with frames. So frames are out of question.

If you open “main.swf “and click “home\_btn”, you’ll see “home.swf” load in, containing 3 buttons. I want these buttons to load in “portfolio.swf” and trigger the corresponding buttons.  
For example: clicking “home\_green\_btn” triggers “sectionLoader” to load “portfolio.swf” and call the function of “portfolio\_green\_btn” called “portfolio\_green\_Click” which loads “green.swf”

The closest I could get is, to get “home\_green\_btn” to go to “portfolio.swf” by calling on the “gotoPortfolio” function, which I scripted into “main.swf”

You tell me if it’s possible. My best guess would be the use of Local Connection, but I couldn’t figure it out. If you have a solution and you could upload an updated version of my sample site, that would be great.  
Thanks!

ActionScript 3.0, Flash Player 10
