flash cookie的制作和使用例子详解 三

flash cookie的制作和使用例子详解 三前面的两篇博客介绍的是怎么用页面来操作flashcookie,还要放在容器里运行,这篇做一个简单的仅仅使用flash就可以读写flashcookie的例子先看flash中的代码,当然这次要在flash中定义一些button显示,输入等控件,看页面就知道定义了哪些控件,再看代码就知道这些控件被命名成什么[img]http://dl2.iteye.com/upload/attac…

大家好,又见面了,我是你们的朋友全栈君。前面的两篇博客介绍的是怎么用页面来操作flash cookie,还要放在容器里运行,这篇做一个简单的仅仅使用flash就可以读写flash cookie的例子

先看flash中的代码,当然这次要在flash中定义一些button 显示,输入等控件,看页面就知道定义了哪些控件,再看代码就知道这些控件被命名成什么

[img]http://dl2.iteye.com/upload/attachment/0084/9022/2f793baa-a940-359d-839c-66a9d6347889.png[/img]

先看flash中的代码


var myCookie:Cookie= new Cookie();
setFCButton.addEventListener(MouseEvent.CLICK,setFC)
function setFC(evt: Event){
var obj:Object = new Object();
obj.userName=userNameInput.text
obj.sex=sexInput.text;
myCookie.put("userInfo",obj);

}
getFCButton.addEventListener(MouseEvent.CLICK,getFC)
function getFC(evt: Event):void{
fcDisplay.text = "userName:"+myCookie.get("userInfo").userName;
fcDisplay.text = fcDisplay.text + " sex:"+myCookie.get("userInfo").sex;
}

上面调用 var myCookie:Cookie= new Cookie(); cookie这个类和前面两篇用的是一模一样的

其实有了上面的东西就可以在adobe flash cs5里测试运行了。或着打开生成的swf也是一样的,再就是先前面一样,嵌入到html中用浏览器打开

html代码如下:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN" xml:lang="zh-CN">
<head>
<title>testFC</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
html, body { height:100%; background-color: #ffffff;}
body { margin:0; padding:0; overflow:hidden; }
#flashContent { width:100%; height:100%; }
</style>

</head>

<body>


<div id="flashContent">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="500" height="500" id="testFC" title="testFC" align="middle">
<param name="allowScriptAccess" value="always" />
<param name="movie" value="testFC.swf">
<param name="quality" value="high">
<param name="wmode" value="transparent" />
<embed src="testFC.swf" name="testFC" quality="high" allowScriptAccess="always" swLiveConnect="true" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="500" height="500"></embed>
</object>
</div>
</body>
</html>


版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/159892.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 服务器安装黑苹果系统,黑苹果 单系统安装教程

    服务器安装黑苹果系统,黑苹果 单系统安装教程黑苹果单系统安装教程[2021-02-1509:58:46]简介:php去除nbsp的方法:首先创建一个PHP代码示例文件;然后通过“preg_replace(“/(\s|\&nbsp\;| |\xc2\xa0)/”,””,strip_tags($val));”方法去除所有nbsp即可。推荐:《PHP视频教中国网科技7月24日讯今日,工信部发布今年第三批侵害用户权益行为的A…

    2022年5月5日
    115
  • Excel去除空行的各种方法_批量删除所有空行

    Excel去除空行的各种方法_批量删除所有空行本文转载至:https://baijiahao.baidu.com/s?id=1590204478648348952&wfr=spider&for=pc,需要详细信息可链接查看方法一

    2022年8月2日
    9
  • SCTP标准简介Part I:SCTP连接建立

    SCTP标准简介Part I:SCTP连接建立SCTP 协议最新版本是 RFC4960 以下简单介绍 SCTP 标准中的一些基本概念 希望对大家阅读 SCTP 相关标准时有所帮助 详细资料可以参考 RFC 水平所限 有错漏之处请见谅 1 SCTP 包的格式 nbsp 0 nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp 1 nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp 2 nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp 3 nbsp nbsp nbsp 02

    2026年1月14日
    1
  • OleDbCommand更新数据的一些问题

    OleDbCommand更新数据的一些问题using(OleDbConnectionconnection1=newOleDbConnection(connectionString)){OleDbCommandcommand1=newOleDbCommand();command1.Connection=connection1;

    2022年5月12日
    42
  • Matlab plot绘图颜色详解

    Matlab plot绘图颜色详解转自:https://blog.csdn.net/jirryzhang/article/details/77374702MATLABplot画线的颜色设定plot中画线的颜色通常是八种:标记符颜色r红g绿b蓝c蓝绿m紫红y…

    2022年5月16日
    346
  • tabnine激活码【注册码】

    tabnine激活码【注册码】,https://javaforall.net/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

    2022年3月20日
    53

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号