/    Sign up×
Community /Pin to ProfileBookmark

Javascript-IFrame-AS2.0 Help

Could someone please help me troubleshoot this problem?

my page loads a ‘container’ SWF.
there is an iframe on the page
the IFrame has links, each link should load a new swf into the ‘container’

main page JS..

<script language=”javascript”>
<!–
function thisMovie(movieName) {
if (navigator.appName.indexOf(“Microsoft”) != -1) {
return window[movieName];
} else {
return document[movieName];
}
}

function loadMedical(value) {
thisMovie(value).medical();
alert (‘gee, it works!’)
}

–>
</script>

Button link in the IFrame…
<form>
<a href=”#” onClick=”parent.loadMedical(‘movie’);”>button</a>
</form>

Actionscript…

import flash.external.ExternalInterface;

ExternalInterface.addCallback(“medical”, null, medical);

function medical():Void {
unloadMovie(mc_loadMovie);
mc_loadMovie.loadMovie(‘swf/medical.swf’)
getURL(‘home_medical.html’,’textarea’);
}

I got it to work when the links are on the main page, but not when in the iframe. I’m guessing it a parent window issue? any clues?

Thanks!
Hiren

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @hpaum99 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...