A Flash Developer Resource Site

Results 1 to 20 of 24

Thread: [Resolved] [Resolved] [Resolved] [Resolved] [Resolved] [Resolved] [Resolved] [Resolved] [Resolved] [

Hybrid View

  1. #1
    Senior Member
    Join Date
    Jun 2001
    Location
    Virginia, USA
    Posts
    437
    Oppp, one small error. Change this
    Code:
    window.document.FlashTest.SetVariable("myVar", myValue);
    to this
    Code:
    window.document.FlashTest.SetVariable("var", myValue);
    Because we have _root.var not _root.myVar. By the way, variable var wont' work, it is reserved word. I know I know, I was stupid to name it like that. So change it to something else.

    Sorry

  2. #2
    Member
    Join Date
    Nov 2000
    Location
    South East UK
    Posts
    91
    Hate to say this guys... but it seems the FlashPlayer version 7 and 8 have major bugs that apparently stop this methodology working as well as it used to - I know I've had problems for the 18 months using this method, in fact I've had to curtail my flash integration projects as a result of this issue.
    I know I had problems back then, but it was the time that Player 6 was around, the only thing the setVariable method didnt work on was IE on the mac.

    Ironically, it seems also you can't even send variables in anymore on the url either....which is the most basic way of sending data into a flash movie from html.
    e.g. (in html object/embed tags)
    "moviename.swf?test=ok&test2=ok"

    This is really serious, as a lot of advanced flash apps rely on this communication method...

    and by the looks of things it has been ignored by Macromedia/Adobe....
    A search of their site returns nothing for the "Error calling method on NPObject!"

    After some digging around on the net, I thought I'd post what I found to help... see the following links.

    http://flashmx2004.com/forums/index.php?showtopic=8871

    http://www.webdeveloper.com/forum/sh...d.php?p=517296

    and another useful post that might come from a past colleague of mine here...where Chris suggests delaying the communication slightly - e.g. using a method like this....
    <BODY OnLoad=setTimeout("alert('test');flashFunc('docroo t','<?=$DOCROOT?>')",2000);>

    However - I just tried the above without success... I'm trying to send in a PHP variable containing the root of the website path into the movie, so that the navigation buttons use the right path, wherever it is called from.

    The javascript alert triggers, there are no Javascript errors in firefox, but the flashmovie just sits in a loop waiting for the info and nothing happens... my movie has a dynamic text field that shows the value of "_root.docroot" and it remains blank, while the movie checks its value before proceeding...

    perhaps someone else expand on this and could help...(see Chris' post below - Hi Chris if you've seen this!!!)

    http://blog.gilluminate.com/?b=20041208120812

    ----------------------------------------
    // Chris Williams December 21, 2005 - 8:34 am
    I have noticed that in Firefox (v1.1 and 1.5) if I have many flash elements loading on a page and try to call the SetVariable function from body onLoad I get the following error: "Error calling method on NPObject!" I have since worked it out that this is caused when the call to the flash movie is done before the movie is loaded. To rectify this, I have simply added a setTimeout call to the javascript so that the function is called 1-2 seconds after the page has loaded, but I suppose you could add something into the movie to say it has loaded. I just thought someone might like to know this - and seeing as this board came up quite highly on google when I was trying to fix this issue I thought I would post it here!
    ------------------------------------------

    Regards

    Derek Foley

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