A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: 'theMovie' is not an object :(

Hybrid View

  1. #1
    Junior Member
    Join Date
    Jul 2000
    Posts
    15
    var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
    var theMovie = InternetExplorer ? window.intro : window.document.intro;
    WM_setCookie('cookie', 'false');
    var info = WM_readCookie('cookie');
    theMovie.SetVariable("abc",info);

    ---------

    in flash:

    If (abc = "true")
    Go to and Play (Scene 1, 225)
    Else If (abc = "false")
    Go to and Play (2)
    End If


    ---------

    After this, i still get

    'theMovie' is not an object

  2. #2
    Junior Member
    Join Date
    Jul 2000
    Posts
    17
    I may not be the expert around here(check the handle), but maybe I can help.

    Did you make sure that the variable you created for you movie was loaded after the page? If you set the variable in the header, the variable is loaded for the movie before the object is even loaded. Thus the error "theMovie is not an object". The movie must exist on the page before the variable can be created for it.

    You can create an init() function to load the movie variable after the page is loaded like this.

    <!--
    var InternetExplorer = navigator.appName.indexOf("Microsoft")!= -1

    function init(){
    theMovie = InternetExplorer ? window.movie:window.document.movie
    }
    //Whatever other code you want to put in.
    -->

    Then, in the body tag, set the onLoad equal to "init()". This will load up your variable after the movie object has been loaded.

    Hopefully this helps.

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