# Whats the best Method for navigating html from flash & vice versa?

**URL:** <https://forum.kirupa.com/t/whats-the-best-method-for-navigating-html-from-flash-vice-versa/236186>\
**Category:** Uncategorized\
**Created:** [August 18, 2007, 12:24am UTC](https://forum.kirupa.com/t/whats-the-best-method-for-navigating-html-from-flash-vice-versa/236186 "2007-08-18T00:24:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![camoconnell\_com](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/camoconnell_com/32/3655_2.png) [@camoconnell\_com](https://forum.kirupa.com/u/camoconnell_com)\
**Post date:** [August 18, 2007, 12:24am UTC](https://forum.kirupa.com/t/whats-the-best-method-for-navigating-html-from-flash-vice-versa/236186/1 "2007-08-18T00:24:18Z")

</div>

hey all

ok, so basically i need to find out the best Method for navigating html from flash & vice versa.  
\*  
HERES MY CURRENT STRATEGY…\*  
**flash;**  
the flash banner will be just the one swf, it will navigate through the html content with the getURL function

**html**  
each html page has the flash swf embedded using swfobject, a unique ‘loadstate’ variable will be passed from the html to flash,  
eg. for the homepage it’ll be;

```auto
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("/swfs/header.swf", "sotester", "924", "350", "8", "#69be28");
so.addVariable("loadstate", "home"); 
so.write("flashcontent");
// ]]>
</script>

```

**flash;**  
flash will receive this loadstate variable, then using switch/case it will gotoAndStop on the appropriate frame.  
e.g

[AS]// check variable passed from html, then play approiate frame  
switch (loadstate) {  
case “Home” :  
castMC.gotoAndPlay(1);  
break;  
case “Renewal” :  
castMC.gotoAndPlay(2);  
break;  
case “Growth” :  
castMC.gotoAndPlay(3);  
break;  
case “Harvest” :  
castMC.gotoAndPlay(4);  
break;  
case “Use” :  
castMC.gotoAndPlay(5);  
break;  
}  
[/AS]

is there a better way of achieving the same result using swfobject to pass the variables to the .swf?

many thanks  
Cam  
:sailor:
