I'm with DL on his suggestion below:)

I've included a couple of example files that can give you some good 
hints on cross frame communication.. I've used Iframes. Give them a 
try and we can talk from that point.
Francis

main.html

<HTML>
<BODY onLoad=init()>
<iframe src=mySVG1.html id=svgFrame1  name=svgFrame1 
style='width:400;height:400' ></iframe>
<iframe src=mySVG2.html id=svgFrame2 name=svgFrame2 
style='width:400;height:400' ></iframe>
<script>
var MySVG1frame
var MySVG2frame
function init()
{
        MySVG1frame=parent.frames.svgFrame1
        MySVG2frame=parent.frames.svgFrame2
        //---give frames main object---
        MySVG1frame.init()
        MySVG2frame.init()
}

//---fired from frames---
function talkToMe(msg)
{
        alert(msg)
}
</script>
</BODY>
</HTML>

mySVG1.html
<HTML>
<BODY>
        <embed name="svgEmbed1"  src="mySVG1.svg" 
style="width:100%;height:100%" type="image/svg+xml">
<script>
//---fired on main load---
var main
var MySVG2frame
var MySVG1doc
function init()
{
        main=parent.frames.top
        MySVG2frame=main.MySVG2frame
        MySVG1doc=document.embeds["svgEmbed1"].getSVGDocument()
}

function  crossTalk()
{
        MySVG2frame.helloWorld()
}
//---called from svg2---
function helloWorld()
{
        text1=MySVG1doc.getElementById("text1")
        text1.firstChild.setData("hello from SVG2")
        main.talkToMe("SVG2 says hello")
}

</script>
</BODY>
</HTML>

mySVG2.html
<HTML>
<BODY>
        <embed name="svgEmbed2"  src="mySVG2.svg" 
style="width:100%;height:100%" type="image/svg+xml">

<script>
//---fired on main load---
var main
var MySVG1frame
var MySVG2doc
function init()
{
        main=parent.frames.top
        MySVG1frame=main.MySVG1frame
        MySVG2doc=document.embeds["svgEmbed2"].getSVGDocument()
}
function  crossTalk()
{
        MySVG1frame.helloWorld()
}
//---called from svg1---
function helloWorld()
{
        text1=MySVG2doc.getElementById("text1")
        text1.firstChild.setData("hello from SVG1")
        main.talkToMe("SVG1 says hello")
}
</script>
</BODY>
</HTML>

mySVG1.svg

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 
1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"; >
<svg id="mySVG1"  >
<circle id="circle1" cx="200"  cy="200"  r="100"  fill="red"  
onclick="crossTalk()" />
<text id="text1" style="font-family:arial;font-size:20;fill:black" 
x="120" y="50">SVG1</text>
</svg>


mySVG2.svg

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 
1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"; >
<svg id="mySVG2"  >
        <circle id="circle1" cx="200"  cy="200"  r="100"  
fill="blue"   onclick="crossTalk()"  />
        <text id="text1"  style="font-family:arial;font-
size:20;fill:black" x="120" y="50">SVG2</text>
</svg>




--- In [email protected], "DL" <[EMAIL PROTECTED]> wrote:
> On 6 Jun 2005 at 16:38, Erwan TROEL wrote:
> 
> > here is my script: temp.js
> 
> Wow .. that is quite complex ..
> 
> I would get the cross frame navigation working first on a simpler 
example.
> 





-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to