A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Controlling loadMovie with Javascript

  1. #1
    Junior Member
    Join Date
    Jan 2004
    Posts
    1

    Controlling loadMovie with Javascript

    Hi Guys,

    Is there a way that you can control a flash movie using HTML and/or Javascript on the same page?

    This is the code I am currently using but I get a "_root is undefined" error.



    << <script language="JavaScript" type="text/JavaScript">
    function flashLoad(){
    //alert("test");
    window.document.docContainer.loadMovie("Untitled-1.swf",_root.docFrame);
    }
    </script> >>



    there is a flash movie on the same page with an ID and NAME of docContainer.

    The fuction is actioned by an onClick event.
    When I click I get the TEST alert box but then get the undefined error.

    Does anyone know why?
    Am I able to use the loadMovie via Javascript.

    Thanks in advance
    --Neil

  2. #2
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    try something like this,

    Code:
    <script language="JavaScript" type="text/JavaScript">
    function flashLoad(){
        window.document.docContainer.LoadMovie(1, "Untitled-1.swf");
    }
    </script>
    http://www.macromedia.com/support/fl...hflash_03.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center