【问题标题】:Json communication between flash and javascriptflash和javascript之间的Json通信
【发布时间】:2010-01-20 15:04:13
【问题描述】:

注意:使用 django/python/javascript/flash

所以我已经两天没有遇到错误了。我做了你告诉我的事情,并找到了几种解决方法,但没有任何效果。这些是结果。

Javascript 没有接收到它必须是 json 对象的正常字符串。在views.py中

somestring = json.dumps("HELLO WORLD")

在 HTML 中呈现它

"HELLO WORLD"

在javascript中它是这样呈现的

a240527176321_quote_hello 

现在,由于它是一个 json 对象,我需要将它转换回 flash 中。但是当它进入闪存时,我会像这样收到它

function something(hellovar){
.....
......
}

它甚至没有进入函数内部。有什么想法吗?

【问题讨论】:

    标签: python flash json


    【解决方案1】:

    为什么flash和js之间通过json进行通信? actionscript 在ExternalInterface 中有一个非常强大的构建来与javascript 通信。

    【讨论】:

    • 我正在使用本地连接进行通信,主要问题是这一行。它适用于其他一切。 function sendScoreList(test){ testtext={{varsomething}} document.getElementById('leaderboard_swf').callSWF('asMethod',testtext); } 其中 varsomething 来自服务器
    猜你喜欢
    • 2010-12-12
    • 1970-01-01
    • 2011-03-22
    • 2012-11-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多