tags:

views:

70

answers:

4

Something wrong with the code? I could print Hello on HTML but when I add to getPlayerVersion, the whole string doesn't print. What could be problem be? Leaving me feeling frustrated.

<script type="text/javascript">
document.write("Hello"+deconcept.SWFObjectUtil.getPlayerVersion().major);
</script>
A: 

It's likely that one of the properties you are referring to doesn't exist. Try debugging by starting from "Hello" + deconcept, then "Hello" + deconcept.SWFObjectUtil, etc.

djc
I used an old version of SWFObject 1.4 is able to print, and the latest version 2.2 doesn't work. Why make so difficult to upgrade?
proyb2
+1  A: 

I think you've established that document.write isn't the problem, seeing as it already worked without getPlayerVersion....

Check your browser's error console. Or, possibly:

<script>
    try {
        document.write("Hello"+deconcept.SWFObjectUtil.getPlayerVersion().major);
    } catch(e) {
        alert(e.message);
    } 
</script>

This will hopefully give you a better idea of whatever exception is being thrown.

J-P
very useful method of catching a message!
proyb2
A: 

Try combining "major" with "minor" and "release" to get the complete version signature of Flash.

    document.write("Major: "+deconcept.SWFObjectUtil.getPlayerVersion().major);
    document.write("<br />Minor: "+deconcept.SWFObjectUtil.getPlayerVersion().minor);
    document.write("<br />Release: "+deconcept.SWFObjectUtil.getPlayerVersion().release);
Andrew
And how should this help?
Sean Kinsey
Frankly, I don't thing the original poster understands the data he's seeing. The 'whole string' of the 'major' property of playerVersion is "10" (or 9 or 8, etc). I think what he's expecting is 10.0.23.45 or something like that.
Andrew
A: 

Ok, I have a next question regarding the code that need your help.

http://stackoverflow.com/questions/2984615/unable-to-document-write-on-this-code

proyb2
@proyb please start asking proper questions, and give some feedback on how this question was solved. Also, it is good form to accept an answer if one was helpful.
Pekka
Please don't do that. Obviously this is not an answer to your question. Your new question will show up at the frontpage, that is enough. Also accept the answers to your questions that helped you.
Felix Kling
I found there was no problem except the next question which contain the part of the code caused it not to execute.
proyb2
@Felix Kling, thank for advice but I did not create an SO account
proyb2