[Transmitted]PHP and FLEX communication

C# 自定义文本编辑器控件中 中文重复出现问题 毕设时做的一个代码编辑器,基于开源项目Fireball(http://www.codeplex.com/dotnetfireball)。在其中实现了语法加亮,括号匹配等通用代码编辑器的基础上,添加了基于DLL文件的智能提示功能。不过随后发现当输入中文的时候,在代码编辑器中会重复出现输入的中文。 最近,当时的老师让修改一下这个bug,追踪代码中的事件处理,发现当输入中文的时候有两个事件WM_IME 阅读详情

[Original]http://nitingore.wordpress.com/2007/07/19/php-and-flex-communication/

Communication between PHP and Flash using POST method of HTTPService service:-

Here I have created Flex project which passes two variables to PHP and get the sum back from PHP and displays the same in Flex. You need to send the variables in “name” “value” to PHP page as shown in code, same name value pair can be passed as Sum_HttpServ.send({num1:’3′,num2:’6′});

Below is the code written in Flex application:-

<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”absolute” creationComplete=”fnCreationComplete()”>
                <mx:HTTPService id=”Sum_HttpServ” url=”http://yourDomain/someFolder/GetSum.php” result=”fnDiplayResult(event)” fault=”fnHandleFault(event)”/>
<mx:Script>
                <![CDATA[
                               import mx.rpc.events.ResultEvent;
                                import mx.controls.Alert;                              

                                private function fnCreationComplete():void{
                                                var Obj:Object=new Object();
                                                Obj.num1=2;
                                                Obj.num2=5;
                                                Sum_HttpServ.method="POST";
                                                Sum_HttpServ.send(Obj);
                                }
                                private function fnHandleFault(event:FaultEvent):void{
                                               Alert.show("Error ID="+event.fault.errorID+"  faultString="+event.fault.faultString);
                                }

                                private function fnDiplayResult(event:ResultEvent):void{
                                                Alert.show(event.result.toString());
                                }
                ]]>
</mx:Script>         
</mx:Application>

Below is the code written in the PHP “http://yourDomain/someFolder/GetSum.php” page which is placed on remote machine in virtual directory

<?
$Number1=$_POST['num1'];
$Number2=$_POST['num2'];
print ($Number1+$Number2);
?>

To use GET method, you need to change Sum_HttpServ.method=”POST”; in flex project and use $_GET[‘num1'] and $_GET[‘num2'] in PHP page.

Getting Multiple parameters from PHP:-
To return the multiple parameters from PHP you can return the variables separated by ampersand (&) if you are using flashvars as resultFormat. There are fore more formats namely “text”, “array”, “xml”, “e4x” you can use anyone as per your need but depending on that you will have to format your response object in PHP.  Here I am using flashvars as result format.

Below is the PHP code that returns addition & multiplication of variable.

<?
$Number1=$_POST['num1'];
$Number2=$_POST['num2'];
$Multiplication=$Number1*$Number2;
$Addition=$Number1+$Number2;
print “Addition=$Addition&Multiplication=$Multiplication”;
?>

And now you are ready to send the variables from PHP. Now in flex application, your fnDiplayResult() function will change to

private function fnDiplayResult(event:ResultEvent):void{
                                Alert.show(”Addition = “+event.result.Addition);
                                Alert.show(”Multiplication = “+event.result.Multiplication);
                }

And add line Sum_HttpServ.resultFormat=”flashvars”; in fnCreationComplete() function before you send the parameters to PHP.

华为OD机考双机位C卷 - 补种未成活胡杨 (Java & Python& JS & C/C++ & GO ) 华为OD机考双机位C卷 - 补种未成活胡杨(OD上机考试双机位C卷)。提供在线OJ刷题。Java、C++、Python、GO语言、C语言、JavaScript题解,并提供完整思路讲解。 阅读详情

相关推荐

绝缘检测原理和绝缘电阻计算方法

绝缘检测的目的就是计算绝缘电阻,当绝缘电阻低于某个阈值,则很可能会造成电池短路、漏电,威胁人员安全

m0_56208280的博客 4万+

[Transferred][Problem]Microsoft Word: "Macros in this project are disabled"

When starting and closing Microsoft Word, a message box appears headed "Microsoft Visual Basic" which states: "The macros in this project are disabled. Please refer to the online help or documentation

Dream & Passion 1674

2022年全球市场微波等离子体CVD反应器总体规模、主要生产商、主要地区、产品和应用细分研究报告

据GIR (Global Info Research)调研,按收入计,2021年全球微波等离子体CVD反应器收入大约 百万美元,预计2028年达到 百万美元,2022至2028期间,年复合增长率CAGR为 %。

MARKETRESEARCH的博客 1137

Checking the close event of browser in flex

Modify the index.template.html file by adding in the following scripts: 1: "JavaScript" type="text/javascript"> 2: window.onbeforeunload = clean_up; 3:   4: function

Dream & Passion 1042

window部署open claw(使用wsl-Ubuntu-docker部署)

本文详细介绍了在Windows 11系统下通过WSL2+Docker部署OpenClaw的完整流程。首先需要满足硬件配置要求并开启虚拟化功能,然后依次完成WSL2安装配置、Docker Desktop安装、OpenClaw镜像拉取等步骤。重点说明了端口映射、socat转发配置及openclaw.json文件修改方法。最后通过验证WSL2内网IP和端口访问服务。该方案具有最佳兼容性,能有效避免Windows环境下的依赖冲突问题。

Kmoyic的博客 2763

手把手教你学PCIE(10.5)--PCIE故障排除方法的分步排查法介绍

通过以上分步排查法,你可以系统地诊断和解决 PCIe 设备的故障。每个步骤都有助于逐步缩小问题范围,最终找到并解决问题。

MHD0815的博客 1873

Take use of the line printer in Soc

Use the line printer in Soc, one can only print *.txt files and must send the print command form Unix environment. Another alternative is to use the SSH client. Obtaining and Installing SSH for Wind

Dream & Passion 879

Android13无重力感应系统修改触摸屏跟随屏幕显示旋转方向旋转

在实际产品中设计时会移除重力传感器。当设备缺少重力传感器时,系统无法使用该传感器提供的方向数据来确定屏幕旋转的方向。Android 系统中由于移除重力传感器导致的默认显示方向旋转引起触摸屏与屏幕显示不一致问题,主要是由于缺乏方向检测和触摸坐标的正确转换。通过使用替代传感器(如陀螺仪)、手动配置方向、调整触摸事件坐标和 UI 布局,可以解决这个问题。开发者需要确保在设备没有重力传感器的情况下,能够通过其他方法推测方向,并确保触摸事件和 UI 动作能够正确响应设备的旋转。

weixin_35723192的博客 803

J.K.Rowling's newest book - The tales of Beedle the Bard

The Tales of Beedle the Bard Publish at Scribd or explore others: Fiction Literature harry potter and the J.K. Rowling

Dream & Passion 688

innovus:ccopt_design分段长tree操作

这步don't touch保证后面完整cts尽量不会动到已经长过的tree。需要给sub tree手写一个spec,参考create_ccopt_clock_tree_spec -file的写法,只写create_ccopt_clock_tree和skew group部分就行。

m0_61544122的博客 1677

AI赋能合同审查:构建租赁合同智能审核系统的全流程解析

在商业地产、设备租赁等场景中,合同审核效率直接影响业务流转速度。传统人工审核存在三大痛点:审核周期长(平均2-3个工作日)、合规风险高(条款遗漏率约15%)、人力成本居高不下。智能审核系统可将审核时间压缩至秒级,风险识别准确率提升至98%以上。

理论都是虚的,代码才是王道。 1356

[Transferred] Create a new Drive or Partition in Windows Vista

Carefully follow these steps to create a new drive or partition in Windows Vista. I am sure you had a hard time creating additional drives in your older version of Windows. Vista makes it very simpl

Dream & Passion 584

15、Qt开发中的停靠窗口、工具栏与多文档界面实现

本文详细介绍了Qt开发中停靠窗口、工具栏与多文档界面(MDI)的实现方法。通过QDockWidget和QToolBar构建灵活的用户界面,并利用QMainWindow的saveState和restoreState功能实现布局持久化;使用QMdiArea和QMdiSubWindow实现多文档管理,结合MainWindow与Editor类完成文件操作与窗口控制。文章包含完整代码示例、流程图与表格总结,适用于开发集成环境、文本编辑器等复杂桌面应用。

snow3的博客 163

[Video] History of the Internet

      http://www.youtube.com/watch?v=9hIQjrMHTv4

Dream & Passion 575

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

News Digest

The Sum of Your Facial Parts New York Times (10/09/08) Kershaw, Sarah Researchers at Tel Aviv University have developed "beautification engine" software that uses a mathematical formula to alter

Dream & Passion 495

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

Talk: Google for developers

Last afternoon, Patric held a talk about google for developers. During this talk, he introduced us about following useful tools: Gears. Improving the web browser.http://gears.google.com/ Gapminder.

Dream & Passion 475

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

Flex quick start guide for PHP developers

Today during solving my own problem, I found this useful page about Flex and PHP. Original Page:http://www.adobe.com/devnet/flex/articles/php_getstarted.html The outline is : Contents Introduc

Dream & Passion 442

School Wireless problem

When I connect to the wireless network at school, it promotes a login window to login using my socnet id. However, no matter how many times I tried, I was always rejected. I have no idea about how to

Dream & Passion 420

Surface & Sphere - Microsoft

I like Microsoft. They always give me amazing techniques! PDC 2008 Microsoft surface demo: Microsoft Surface Demos - PDC 2008 from Tom Warren on Vimeo. Sphere computer: ";" alt=""> Anoth

Dream & Passion 416

给 LikeShop 加一个自定义分销佣金规则:改了哪几个文件

为在LikeShop中添加自定义分销佣金规则(如二级分销商团队激励),需精准定位核心文件:DistributionLogic.php 实现计算逻辑扩展,后台配置逻辑支持可配性,数据库迁移新增字段。关键在于不硬编码比例,通过租户隔离的配置表实现灵活管理。结算与售后逻辑仅在涉及差异化条件时才需调整。务必验证全链路状态流转,避免“算对但结不了”或“退了仍返佣”问题。核心改动聚焦于计算、配置、数据三端,确保可维护性与可配置性。

hudie765的博客 293

Calico 网络插件实战

集群外部主机可以访问集群内部应用集群内部应用也可以访问集群外部主机各个namespace之间没有做任何的隔离策略如果希望在 IP 地址或端口层面控制网络流量, 考虑使用 Kubernetes 网络策略(NetworkPolicy)。NetworkPolicy 是一种以应用为中心的结构,允许你设置如何允许Pod与网络上的各类网络“实体” 通信。NetworkPolicy 适用于一端或两端与 Pod 的连接,与其他连接无关。**提示:**网络策略通过网络插件来实现。

weixin_63581562的博客 417

GitHub 热榜项目:日榜(2026-11-07)

给编码智能体配技能的项目最热:cloudflare/security-audit-skill 把审计拆成六阶段并输出可验证 JSON,新增 2,548 星;mattpocock/skills 把工程技能放进 .agents 目录,新增 2,070 星。Web 应用框架也有四个项目集中上榜,以 react/react 为代表。

u130130的博客 387

ThinkPHP+UniApp 多端圈子系统如何设计:论坛内容、实时会话与交易模块的技术实现!

本文介绍基于ThinkPHP与UniApp的多端兴趣圈子系统设计,实现小程序、H5、App三端统一账号与数据同步。系统采用模块化架构,支持圈子管理、论坛互动、实时会话与可选交易功能,通过统一消息中心复用通知与会话通道,保障跨端一致性。核心亮点包括权限清晰的圈主与平台管理分离、内容核验前置、数据冷热分离及缓存优化,确保系统可扩展、易维护,适用于同好社群、本地团体等场景。

2603_96017077的博客 158

CTF2困难部分

该题为一道综合型Web安全挑战,涉及SSTI(服务器端模板注入)、LFI(本地文件包含)、PHAR反序列化、命令执行及SQL注入。攻击者通过绕过WAF限制,利用Jinja2模板的__builtins__和getattr等机制实现任意文件读取与命令执行;结合PHAR文件伪造触发反序列化漏洞,写入webshell并读取flag;同时在数据库查询中通过注释绕过空格过滤,联合注入获取敏感信息。最终成功获取flag:CTF2{b62c748a-160c-481c-9068-03dfe68ae1d9}。

fengci111的博客 173

零信任架构实战:基于天远单人婚姻查询构建自动化智慧住房资格核验网关

破解公租房资格核查痛点:从传统纸质婚姻凭证抽检到权威民政数据穿透直连 在智慧城市公共租赁住房(公租房)、保障性租赁住房以及共有产权房等民生保障工程中,保障房资源的公平精准分配是住房保障管理中台的核心职责。按照现行住房保障准入政策,申请主体的家庭结构直接决定了配租资格准入与面积配给标准:单身家庭申请人通常享有特定的单人保障配额与独立的财产评估标准,要求申请人具

2501_94042197的博客 191

Docker 部署 WordPress+MySQL 高可用架构

点「安装 WordPress」

一直在努力学习的菜鸟 227
上一篇: Be careful about the angles
下一篇: Flex quick start guide for PHP developers
itroy
博客等级 码龄18年 7粉丝 116原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值