How to access embeds in another frame

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Julius Mong

    How to access embeds in another frame

    Dear all, if I have something like this:

    <html>
    <body>
    <embed src="..." id="svgPage" />
    </body>
    </html>

    and I did this in the same doc:

    SVGDoc = document.embeds["svgPage"].getSVGDocument ();
    SVGRoot = SVGDoc.getDocum entElement();

    I will get the SVG doc in the embed, fantastic.

    But if I have 2 frames, with "left" and "right" named respectively, and want
    to access the embed in the right frame which contains the html doc above. I
    tried this:

    SVGDoc = parent.right.do cument.embeds["svgPage"].getSVGDocument ();
    SVGRoot = SVGDoc.getDocum entElement();
    fx = SVGRoot.current Translate.x;

    And IE would complain that line 14 char 5 : Object required, and line 14 is
    the fx = ... line so I suppose SVGDoc wasn't initiated properly and hence
    SVGRoot wasn't either. I have no idea why this wouldn't work... could
    someone point me in the right direction please...

    Thanks, Jules

    The html containing the 2 frames is:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
    <html>
    <frameset cols="20%,*" ...>
    <frame name='left' src='left.html' scrolling='auto ' ...>
    <frame name='right' src='page.html' border='0' ...>
    </frameset>
    </html>


  • Michael Winter

    #2
    Re: How to access embeds in another frame

    On Mon, 5 Apr 2004 21:24:09 +0100, Julius Mong <jxm96c@hotmail .com> wrote:

    [snip]
    [color=blue]
    > SVGDoc = parent.right.do cument.embeds["svgPage"].getSVGDocument ();
    > SVGRoot = SVGDoc.getDocum entElement();
    > fx = SVGRoot.current Translate.x;
    >
    > And IE would complain that line 14 char 5 : Object required, and line 14
    > is the fx = ... line so I suppose SVGDoc wasn't initiated properly and
    > hence SVGRoot wasn't either. I have no idea why this wouldn't work...
    > could someone point me in the right direction please...[/color]

    At a guess (I've never used SVG), I'd say the problem lies with the
    getDocumentElem ent() method call. The ECMAScript bindings for SVGDocument
    and its base interfaces don't include that method; it is, in fact, a Java
    method. Try using the Document.docume ntElement property instead.

    It would be much easier if you could post a complete example somewhere.

    Mike

    --
    Michael Winter
    M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)

    Comment

    Working...