/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] NPObject?

Hello all.
I am simply trying to use javascript to SetVariable to a flash document, however whenever I try I get “Error calling method on NPObject” (using Firefox, error may be different in other browsers). I can’t find a THING on this (nothing relevant anyway). The relevant line is “flash.SetVariable(var_name, var_val);” (flash is a var containing the document.getElementById.

Any ideas?
Help is HUGELY appreciated… I’ve been stuck on this for over a week!

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@blah1985Feb 17.2006 — try expanding it out( document.getElementById('whatever')

if you still have issues try renaming your function. I know it sounds crazy but it sometimes works(reserverd strings) if that does not work gemme some more code

oh BTW http://www.mozilla.org/projects/plugins/npruntime.html#NPObject
Copy linkTweet thisAlerts:
@ChippyauthorFeb 17.2006 — I don't QUITE get what you mean by expand, so I'll wait on that.

It shouldn't be the function name, because I took the code (and dunction name) from a working example (this is for a production product, so I will rewrite the example code once I get it actually working).
Copy linkTweet thisAlerts:
@ChippyauthorFeb 20.2006 — Ok, so I have broken it down, and got an interesting result. When I use this line:
[CODE]if(document.GWFlash) document.GWFlash.SetVariable("time", "1");[/CODE]
I get an error. This tells me that the object EXISTS (and is definetly the intended flash object) however, for some reason SetVariable will not work....

Anyone have any ideas? Could it have to do with my flash?

As always, help is appreciated ?

EDIT: So, I continued to work on it a bit, and the perplexity of the problem increases: I tried to use an example of the web, and that worked perfectly. I then created a text object on my player exactly the same way the example did it, and ALL I did was change the location of the video.... got the same error: "Error: Error calling method on NPObject!". If anyone wants to take a boo at the source, it is over at http://donut.foxed.ca/hosted/getMedia.php?id=3 on Line 3.

EDIT2: Should I try a flash forum too? They might have some ideas if you folks don't...
Copy linkTweet thisAlerts:
@ChippyauthorFeb 21.2006 — Well, I would now like to hire a hitman to take out the Flash developers... this is the SECOND time on this ONE project I have had a problem related to the FLASH PLAYER VERSION!! Last time I had to go from 8 to 7... and now it seems SetVariable doesn't work with even 7!!!!

That's right ladies and gentlemen. If you want to use Javascript's SetVariable function.... YOU HAVE TO USE FLASH PLAYER 6!!! Not joking in the LEAST.

Hope this helps anyone else trying to do this, it sure was annoying as HELL to go through for the SECOND time on one project alone...
Copy linkTweet thisAlerts:
@gregdavidausJul 13.2006 — Error: Error calling method on NPObject!

Source File: http://localhost:9080/UnileverTest/.ibmjsfres/jsl/jsl_webservice_c.js


function WebServiceControl(flashComp){if(flashComp== null){var Msg= NlsFormatMsg(no_flash_component);throw new EObjectError(Msg);

}

this.flashWS = flashComp;

this.invokeWS = function(callback,operation,wsdl,paramXML)

{

////alert("inside invokeWS");

try

{

flashWS = this.flashWS;

////alert("Setting parameters....");

flashWS.SetVariable("wsdlURL",wsdl); <-- This is where the firefox javascript console points

Any idea why is this happening ?
Copy linkTweet thisAlerts:
@psuhasJul 30.2007 — HI,

I just came across this post and hope this is already solved but if some is looking for the solution,

I had the same problem, in my case I used setVariable call in onload in body tag,

but if you try

function bl()

{

setVariable.......// your code

}

<body onload="setTimeout('bl();',500);" >

That worked just fine for me, may it needs some time to initialize the object,

Try that one! ?
×

Success!

Help @Chippy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.14,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,
)...