Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Javascript -> Flash: Can't find a tutorial.

  1. #11
    Join Date
    Apr 2008
    Location
    San Diego, CA
    Posts
    352
    Thanks
    57
    Thanked 6 Times in 6 Posts

    Default

    Quote Originally Posted by Medyman View Post
    Umm...no, you can use onLoad with the External API. I'm not a JavaScript expert so I can't be sure but there are different ways to call the Flash object depending on browsers. That might be causing a problem. Because it seems like it works in IE and Opera. Seems like Fx is the one with the problem.

    You might want to give this a read and the links/leads on that page.
    Thanks for this link, too, but the example there produces the same error in Firefox.

    They have the initialize() function being called onLoad in the <body> tag, but all it's doing is browser sniffing. If you add in any lines that (try to) affect the Flash movie directly to that function, you get the "not a function" error in Firefox, but again only when using the function via onLoad.

    There is definitely something going on here. There has to be a workaround.


  2. #12
    Join Date
    Apr 2008
    Location
    San Diego, CA
    Posts
    352
    Thanks
    57
    Thanked 6 Times in 6 Posts

    Default

    Okay I found some better search terms for Google (this very thread even came up - I had no idea Google indexed things so fast). Other people have had this problem:

    http://livedocs.adobe.com/flash/8/ma...=00001600.html

    Check the comments.

    QuantumDynamix said on Oct 24, 2006 at 11:01 AM :

    No matter how I approach this, I consistantly get an error in Firefox:

    thisMovie("movieID").functionName is not a function.

    This works PERFECTLY in IE, but keeps giving me problems in Firefox. Any help?

    persisjas said on Mar 28, 2007 at 7:26 PM :

    When i attempted to write into the text input from the JS, it worked. However, my flash cannot write out from the swf into the javascript.

    Is there something wrong with my system? I'm using Flash 8 Professional, running on XP SP2

    No screen name said on Jun 13, 2007 at 7:23 PM :

    I'm having the same issue as QuantumDynamix. Anyone know what's going on?

    No screen name said on Jun 19, 2007 at 2:43 PM :

    QuantumDynamix: I think I know what your problem is

    You are calling your thisMovie("movieID").functionName during your webpage's onload event? If so the problem is that the Flash isn't fully loaded in FF on the page onload event. I suggest that you make a function in your Flash that calls a javascript function that calls your thisMovie("movieID").functionName function(s). That should fix your problem and should involve very little code change.
    I will let you guys know if this is a solution for me.

  3. #13
    Join Date
    Apr 2008
    Location
    San Diego, CA
    Posts
    352
    Thanks
    57
    Thanked 6 Times in 6 Posts

    Default

    YAY I SOLVED IT GO NEWB POWER GO

    So after reading in the quoted text above that the Flash is not fully loaded when the body's onload event fires, I just put a 1 MILLISECOND (yes I'm serious) delay before the function is fired and it fixed the problem.

    What a craptacular headache!

  4. #14
    Join Date
    Apr 2008
    Location
    San Diego, CA
    Posts
    352
    Thanks
    57
    Thanked 6 Times in 6 Posts

    Default

    Whoops, turns out 1 millisecond is enough for that tiny test page, but for the actual website this is all relating to I had to use 50.

    HUGE thanks goes out to Medyman who I would still be at square 1 without.

  5. #15
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Glad you got it working .

  6. #16
    Join Date
    Apr 2008
    Location
    San Diego, CA
    Posts
    352
    Thanks
    57
    Thanked 6 Times in 6 Posts

    Default

    Something to be wary of for Dreamweaver users who find this thread:

    You know the runactivecontent script that dreamweaver gives you so that IE users don't have to click your flash to use it? That script seems to break the External API. And for some reason using the External API with your flash movie disables the need to first activate a flash movie in IE just the way the runativecontent script does.

    :shrug:

Bookmarks

Posting Permissions

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